1.IM2BW (Image, Threshold_value)
2. Maximum class part variance (Ostu):
MATLAB:IM2BW (image, Graythresh (image))
3.bernsen algorithm
The more primitive Bernsen:
The main idea of this algorithm is to set the current pixel to P, to calculate the maximum value m and the minimum n for all pixels in the P-centric size (2w+1) * (2w+1) window, the mean t of both,
if (m-n) > S
The threshold for the current point P is t.
Else
The current window area of the gray level difference is small, then the window in the target area or in the background area, if T>t ' The current point gray value is 255, otherwise, the current point grayscale value is 0.
End
The S author was initially set to "T ' set to (255+0)/2=128.
The effect of the most primitive algorithm is generally OK, but the Bernsen algorithm used in general has been improved by various methods.
4.adaptthreshold algorithm
h = fspecial (' average ', [width height]);
Im_mean =uint8 (Filter2 (H, Gray));
Bw = Gray < im_mean-t;
A summary of the method of binary value