PANDORE Version 6 | GREYC-IMAGE |
pcontrastthresholding classifies the input image pixels into a small number of clusters according to their value. Every pixel p of the input image is assigned to a cluster identified by the related threshold value:
if threshold[k-1]<im_out[p]<=threshold[k]. then im_out[p]=threshold[k]
The last threshold is equal to 255.
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 thresholds are located as minima of the mean contrast function.
Returns the number of thresholds.
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 pcontrastthresholding 2 tangram.pan d.pan out.pan
Multi-seuillage 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