Image Processing - Otsu's method


Outline

Otsu's method, also known as the global optimum threshold processing using a clustering idea, the image is divided into "foreground" and "background" categories, and minimize within-class variance of these two types, namely, the maximum variance between classes.

FIG original image 1

FIG 2 using Otsu's method for image binarization

algorithm

\[ \sigma _{w}^{2}(t)=\omega _{0}(t)\sigma _{0}^{2}(t)+\omega _{1}(t)\sigma _{1}^{2}(t) \]

Wherein,
\ (T \) is divided into image "foreground" and "background" of the two threshold value, \ (\ 0} {Omega _ \) and \ (\ omega _ {1} \) are the two class weights, and \ (\ sigma _ {0} ^ {2} \) and \ (\ sigma _ {1} ^ {2} \) are the variances of these two classes.



FIG 3 FIG movable visualization algorithm


Halcon

binary_threshold(Image : Region : Method, LightDark : UsedThreshold)

When Method = 'max_separability'the time, namely Otsu algorithm.

OpenCV

double cv::threshold(InputArray src, OutputArray dst, double thresh, double maxval, int type)

When type = THRESH_BINARY | THRESH_OTSUthe time, namely Otsu algorithm.

reference

Guess you like

Origin www.cnblogs.com/zdfffg/p/11809719.html
Recommended