Skip to content

darshan-gr/Image-Segmentation-of-2D-Images-using-Clustering-based-Image-Thresholding

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Image-Segmentation-of-2D-Images-using-Clustering-based-Image-Thresholding

Image Segmentation into foreground and background using OTSU method

Steps used in OTSU Algorithm:

  1. Compute the histogram of pixel intensities vs the number of pixels
  2. Loop through the grayscale intensities from 0 to 255, setting each as a threshold
  3. Compute the weighted mean, and the variance from the function
  4. Compute the function value at that point
  5. Update minimum variance and then update the threshold

Example implementation The input image is:-

Input Image
The histogram for the given image is:-

Histogram
The output of the binarization is:-

Output

Dependencies

  • Python 3
  • OpenCV
  • Matplotlib
  • Numpy

About

Automatic thresholding of image using OTSU method

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages