Otsu’s Method Algorithm

  1. Compute the normalized histogram of the input image. Denote the components of the histogram by pi.
  2. Compute the cumulative sums P1(k).
  3. Compute the cumulative mean m(k). 
  4. Compute the global intensity mean mG.
  5. Compute the between-class variance σB2(k).
  6. Obtain the optimum threshold k’ for which between-class variance is maximum by iterating over values of k. If more than one maximum exists, obtain k’ by averaging over these values.
  7. Segment the image using the threshold k’ as g(x,y) = 1 if f(x,y)>k’ and g(x,y) = 0 if f(x,y)≤k’.

Optimum Global Thresholding Using Otsu’s Method

Image thresholding is one of the segmentation techniques, that segments or divided the image into two or more different parts based on pixel intensities. There are many different algorithms for carrying out thresholding and here we are going to see one of the most efficient and optimum techniques called Otsu’s method.

Similar Reads

What is Image Thresholding?

Thresholding is the technique of generating a binary image (a binary image is one whose pixels have only two values – 0 and 1 and thus require only one bit to store pixel intensity) from a given greyscale image by separating it into two regions based on a threshold value. Hence pixels having intensity values greater than the said threshold will be treated as white or 1 in the output image and the others will be black or 0....

Otsu’s Thresholding Method

Otsu’s method is a technique of performing global thresholding on a digital image. It is optimum in the sense that it maximizes the between-class variance. The basic crux of the method is that well-thresholded classes of pixels must be distinct with respect to the intensity levels of their pixels and conversely, a threshold that gives the best separation between two different classes of pixels in terms of their intensity levels would be the optimum or the best threshold....

Otsu’s Method Algorithm

Compute the normalized histogram of the input image. Denote the components of the histogram by pi.Compute the cumulative sums P1(k).Compute the cumulative mean m(k). Compute the global intensity mean mG.Compute the between-class variance σB2(k).Obtain the optimum threshold k’ for which between-class variance is maximum by iterating over values of k. If more than one maximum exists, obtain k’ by averaging over these values.Segment the image using the threshold k’ as g(x,y) = 1 if f(x,y)>k’ and g(x,y) = 0 if f(x,y)≤k’....

Implementation

Below is the Matlab code to implement the above approach:...

Contact Us