PANDORE Version 6 GREYC-IMAGE

pcontrastthresholding



Performs multi-thresholding on image based on the boundary contrast value.



Synopsis

pcontrastthresholding nbclass [-m mask] [im_in|-] [im_amp|-] [im_out|-]

Description

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]))

The mean contrast is:

   Cm(s) = C(t) / card(K(t))

Then the thresholds are located as minima of the mean contrast function.

Parameters

Inputs

Outputs

Result

Returns the number of thresholds.

Examples

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

See also

Thresholding

C++ prototype

Errc PContrastThresholding( const Img2duc &im_in1, Img2duc &im_in2, Img2duc &im_out, int nbclass );

Version française

Multi-seuillage de l'image par analyse du contraste aux frontières.

Reference

R. Kohler, "A segmentation system based on thresholding", CGIP, No. 15, pp 319-338, 1981.


Author: Régis Clouard