PANDORE Version 6 | GREYC-IMAGE |
pcontrastbinarization binarizes the input image pixels into a small number of clusters according to their value.
The classification is based on the analysis of the gradient magnitude
along the regions boundaries given in the im_amp image.
The principle is based on the Kohler's algorithm:
Let p and q be two neighbors. A boundary between p and q is
detected by a threshold t if:
im_in[p]<=t<=im_in[q] or im_in[q]<=t<=im_in[p].
Thus, the set of boundary detected by t is:
K(t) = { pair(p,q) / p and q neighbors and im_in[p]<=t<=im_in[q] or im_in[q]<=t<=im_in[p] }
The total contrast of the boundaries detected by t is:
C(t) = sum(min(abs(t-im_in[p]),abs(t-im_in[q]))
Cm(s) = C(t) / card(K(t))
Then the result threshold is the maximum of the mean contrast function.
Returns the threshold value.
Segments tangram pieces:
pgradient 1 tangram.pan a.pan b.pan pnonmaximasuppression a.pan b.pan c.pan pthresholding 10 1e30 c.pan d.pan pcontrastbinarization tangram.pan d.pan out.pan
Binarisation de l'image par analyse du contraste aux frontières.
R. Kohler, "A segmentation system based on thresholding", CGIP, No. 15, pp 319-338, 1981.
Author: Régis Clouard