Skip to content

💡[Feature]: Image segmentation using thresholding techniques #1576

@Suvadip-sana

Description

@Suvadip-sana

Is there an existing issue for this?

  • I have searched the existing issues

Feature Description

This program is for image segmentation using thresholding techniques. It includes two types of thresholding methods: basic global thresholding and Otsu's thresholding. Here’s a breakdown of each section:

Basic Global Thresholding:

The function basic_global_thresholding calculates a global threshold by iteratively finding the mean of foreground and background pixel values. It stops when the difference between the current mean and the previous mean falls below a specified threshold (delthreshold).
Otsu's Thresholding:

The otsu_thresholding function implements Otsu's method, which calculates a threshold that minimizes the intra-class variance (variance within foreground and background regions). This threshold is more effective for bimodal images (images with a clear foreground and background).

Use Case

Image Segmentation:

The function segmented_image applies the calculated threshold (either global or Otsu's) to segment the image into binary values (0 and 1), creating a clear distinction between foreground and background regions.
Visualization:

The program reads a grayscale image, displays the original image, calculates the optimal threshold using Otsu’s method, segments the image based on this threshold, and then displays the segmented (thresholded) image.

Benefits

@sanjay-kv Sir please assign me this. I want to add this under Open CV project.

Add ScreenShots

image
image
image

Priority

High

Record

  • I have read the Contributing Guidelines
  • I'm a GSSOC'24 contributor
  • I want to work on this issue

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions