PANDORE Version 6 | GREYC-IMAGE |
pcontourextensionrect extends all contour end points by a rectangle (or a parallelogram in 3D) defined by the size length x height (or length x height x height for 3D). A contour chain is a sequence of connected non null pixels with 1 pixel thickness. A end point is a contour point with only 1 neighbor. For a 3D extension, the depth is equal to the height.
For example, the 2D contour on the left is extended to the contour on the right if length=4 and height=1.
xxxx xxxx -> xxxxxxxx xxxx
For the current 3D version, height is not taken into account. The extension is only 1 pixel height and depth.
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.
The number of end points.
Closes contours yielded by a simple edge detection of tangram.pan by using an extension of the end points:
psobel tangram.pan b.pan pbinarization 60 1e30 b.pan c.pan pskeletonization c.pan d.pan ppostthinning d.pan e.pan pcontourextensionrect 3 3 e.pan f.pan plabeling 8 f.pan out.pan
Extension des points terminaux dans la direction du contour.
Author: Régis Clouard