PANDORE Version 6 |
GREYC-IMAGE |
pclosedcontourselection
Selects closed contour from length.
Synopsis
pclosedcontourselection relation length [-m mask] [im_in|-] [im_out|-]
Description
pclosedcontourselection selects closed contours
from their length.
A closed contour is a chain of connected non null pixels with 1 pixel thickness
that forms a loop.
The parameter relation specifies the order relation to
the length value that is used to select or not a contour.
Warning: if the contour is not
1 pixel thickness, the operator may have
unpredictable behavior. It might be necessary
to use the operator ppostthinning
to guaranty 1 pixel thickness.
Parameters
- relation is an integer from [-3,3] which specifies
the order relation to the length value:
- relation = 3: closed contours with the maximum length.
- relation = 2: closed contours >= length.
- relation = 1: closed contours > length.
- relation = 0: closed contours = length.
- relation = -1: closed contours < length.
- relation = -2: closed contours <= length.
- relation = -3: closed contours with the minimum length.
- length is an integer defined in pixel unit.
Inputs
- im_in: a 2D or 3D grayscale image of unsigned char (Img2duc or Img2duc).
Outputs
- im_in: an unsigned char image (Img2duc or Img3duc).
Result
The number of selected contours.
Examples
Selects the longest closed contours
from contours yielded by a simple
edge detection of tangram.pan:
psobel tangram.pan b.pan
pbinarization 45 1e30 b.pan c.pan
pskeletonization c.pan d.pan
ppostthinning d.pan e.pan
pclosedcontourselection 3 5 e.pan out.pan
pstatus
See also
Contour
C++ prototype
Errc PClosedContourSelection( const Img2duc &im_in, Img2duc &im_out, int relation, int length );
Version française
Sélection des chaînes de contours fermées sur leur longueur.
Author: Régis Clouard