Image threshold segmentation: Maximum entropy method
January 22, 2024
by Brittany Robinson
No Comments
The principle of image maximum entropy threshold segmentation: make the selected threshold to segment the target area and background area of image gray statistics of the two parts of the maximum information.
Specific description:
1. According to the definition of information entropy, the information entropy of the original image H0 is calculated, and the mean of the maximum and minimum gray scales is selected as the initial threshold T0;
2. According to T0, the image is divided into G1 and G2 regions, with mean values M1 and M2 respectively, and the update threshold T2=0.5*(M1+M2);
3. Calculate the information entropy Hd and Hb of G1 and G2, and compare the size of Hd+Hb and H0. If they are equal or within the specified range, or reach the maximum number of iterations, T2 will be output as the final threshold; otherwise, T0=T2, H0=Hd+Hb, repeat step 2 until the conditions are met.
function ThreshValue = My_MaxEntropy(Imag)
% Maximum entropy calculation threshold
% input:
% Imag: two-dimensional array, numerical value represents gray;