PANDORE Version 6 | GREYC-IMAGE |
pregioneulernumber measures the Euler number of the regions inside the region map rg_in. Each region Euler number is stored as a long value in the array named name inside the collection col_out. The ith item in the array corresponds to the i+1th region because the region 0 is not considered.
The Euler number for a region is defined as 1 - the number of holes in the region.
The algorithm used to calculated the Euler number
rests on the local operation:
Let X(R) the number of the following 2x2 patterns
(r region label for region R, et 0 other labels):
0 0 0 r
Let V(R) the number of the following 2x2 pattern
0 r r r
then Euler(R) = X(R) - V(R)
Returns SUCCESS or FAILURE.
Displays euleur number of the regions yielded by a simple binarization of tangram.pan:
pbinarization 100 1e30 tangram.pan a.pan plabeling 8 a.pan b.pan pregioneulernumber eulernumber b.pan c.pan pcol2txt c.pan
Calcul du nombre d'Euler des régions.
Author: Régis Clouard