MATLAB: How to divide classes in optimum global thresholding using Otsu’s method

Image Processing Toolboximage segmentation

I am implementing optimum global thresholding using otsu's method by referring Gonzalez and Woods book, I am finding difficulty in dividing classes and calculating of cumulative sums, please provide me an matlab code for this algorithm.

Best Answer

See multithresh() or graythresh()