How is the effectiveness metric in Otsu's method (graythresh) calculated?

11 views (last 30 days)
What is the mathematical formula used to evaluate threshold effectiveness metric in graythresh method? What is the best way to use this metric?

Answers (2)

Image Analyst
Image Analyst on 19 May 2015
I don't know and I wouldn't worry about it. It either works or it doesn't, and in my experience, it usually doesn't. It only seems to work well with images that have a uniform background and a nicely bimodal histogram, which is rarely encountered in the real world except in things like machine vision apps that are looking at parts, like for a robot "pick and place" type of app.

sujal
sujal on 14 Sep 2025
What is the effectiveness metric for the dimes image? Recall from PracticeThresholdingGrayscaleImages Reading, effectiveness metric measures how well the threshold found by Otsu's method was able to segment the pixels into the two groups of foreground (white pixels in the masks above, represented by the logical true) and background (black pixels in the above masks, represented by the logical false).
  1 Comment
Image Analyst
Image Analyst on 14 Sep 2025
@sujal, I think he was looking for the exact algorithm, which can be found here: https://en.wikipedia.org/wiki/Otsu's_method
The algorithm exhaustively searches for the threshold that minimizes the intra-class variance, defined as a weighted sum of variances of the two classes. It means that weighted sum of the variances within each class (above and below the threshold) should be at a minimum. Whatever threshold is at that minimum is the threshold to use. More details are in the link I gave above, including MATLAB code for computing it.

Sign in to comment.

Categories

Find more on Image Processing Toolbox in Help Center and File Exchange

Products


Release

R2015a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!