PANDORE Version 6 | GREYC-IMAGE |
pentropybinarization classifies pixels of the input image im_in into 2 clusters. The threshold value is determined as the gray level value s that maximizes the total amount of information provided by the background and the foreground separately. Since information is measured by entropy, the total amount of information for threshold s is:
TE(s) = Eb(s) + Ef(s) { entropy for background + entropy for foreground } = ln[P(s)(1-P(s))] - H(s)/P(s) - H'(s)/(1-P(s)) where P(s) = SUM{i=0->s} [p(i)] and H(s) = SUM{i=0->s} [p(i)*ln(pi)] and H'(s) = SUM{i=s->m-1} [(p(i)*ln(pi)] and W*H is the number of pixels and m is the number of gray levels. and pi = fi/W*H
The maximum entropy criterion is to determine the threshold smax such that:
TE(smax) = max TE(s)
Returns the threshold value.
Segments the tangram pieces:
pentropybinarization tangram.pan a.pan
Binarisation de l'image par maximisation de l'entropie interclasse.
J-C Yen, F-J Chang, S. Chang, "A New Criterion for Automatic Multilevel Thresholding", IEEE Trans. on Image Processing, vol. 4, no. 3, pp 370-378, 1995.
Author: Régis Clouard