PANDORE Version 6 | GREYC-IMAGE |
pweszka 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 number of clusters and the value of the thresholds are determined from the Weszka algorithm. It is based on the measure of the busyness ratio. For each gray level i the busyness ratio is:
busyness(i) = SUM(SUM(Tkl)) + SUM(SUM(Tpq))
with k in [0..i], l in [i+1..N-1], p in [i+1..N-1] and q in [0..i].
The co-occurrence matrix Tkl contains the number of times the gray level k is a neighbor of the gray level l considering the neighborhood Nxy={ (x,y+1), (x,y-1), (x-1,y), (x+1,y) }.
Then the thresholds are located as regional minima of the busyness function. The minima are searched in the space of length gray levels around the gray level i.
Notice: This operator can only work on grayscale image of bytes.
Returns the number of thresholds.
Segments tangram.pan and displays the number of thresholds:
pweszka 10 tangram.pan out.pan pstatus
Multiseuillage de l'image par analyse de la matrice de co-occurence selon Weszka.
J.S. Weszka, "Survey of threshold selection techniques", Computer Graphics and Image Processing, Vol.7, pp. 259-265, 1978.
Author: Régis Clouard