Otsu's method
From Wikipedia, the free encyclopedia
In computer vision and image processing, Otsu's method is used to perform thresholding, or, the reduction of a graylevel image to a binary image. The algorithm assumes the image contains two classes of pixels (e.g. foreground and background) and finds the optimum threshold separating the two classes so that their combined spread (within-class variance) is minimal.[1] The original method was extended to multi-level thresholding,[2] and is referred to as the Multi Otsu method.
Contents |
[edit] Method
In Otsu method we exhaustively search for the threshold that minimizes the within-class variance, defined as a weighted sum of variances of the two classes:
Weights ωi are the probabilities of the two classes separated by a threshold t and σ2i variances of these classes.
Otsu shows that minimizing the within-class variance is the same as maximizing between-class variance:[1]
which is expressed in terms of class probabilities ωi and class means μi which in turn can be updated iteratively. This idea yields an effective algorithm.
[edit] Algorithm
Compute histogram and probabilities of each intensity level Setup initial ωi(0) and μi(0) Step through all possible thresholds t = 1 .. maximum intensity Update ωi and μi Compute σ2b(t) Desired threshold corresponds to the maximum σ2b(t)
[edit] References
[edit] External links
- Lecture notes on thresholding - covers the Otsu method.