Generate XLD contours from regions.
::gen_contour_region_xld generates XLD contours Contours from the regions given in Regions. This operator is useful if regions have been obtained from segmentation operations, but higher level operators, e.g., polygon approximation and extraction of parallels, are to be performed on their boundaries. For each connected component of the input regions a closed contour of the boundary is generated. The parameter Mode can take on the following values:
'center': The centers of the border pixels are used as
contour points.
'border': The outer border of the border pixels is used
as contour points.
The difference between the two modes can be seen by considering the
following region:
+-+-+
| | |
+-+-+-+-+
| | | | | +-+
+-+-+-+-+ where | | symbolizes a single pixel.
| | | | | +-+
+-+-+-+-+
| | |
+-+-+
Then, computing the contour with 'border' and
'center' results in the following two contours,
respectively:
+-+-+
| | *-*
+-+ +-+ / \
| | * *
+ + | |
| | * *
+-+ +-+ \ /
| | *-*
+-+-+
'border' 'center'
This means, for example, that countours generated with
'border' will in general have a much larger Euclidean
length (see ::length_xld) than countours generated with
'center'. This results from the fact that for diagonal
border elements 'border' uses two contour segments of
length 1 each, whereas 'center' uses a single segment of
length sqrt(2). Other features, e.g., the area (see
::area_center_xld), will obviously also have different values.
|
Regions (input_object) |
region(-array) -> Hobject: HRegion(Array) |
| Input regions. | |
|
Contours (output_object) |
xld_cont(-array) -> Hobject * : HXLDCont(Array) |
| Resulting contours. | |
|
Mode (input_control) |
string -> HTuple.char * |
| Mode of contour generation. | |
| Default value: 'border' | |
| List of values: 'border', 'center' | |
::smooth_contours_xld, ::gen_polygons_xld
::gen_contour_polygon_xld, ::get_region_contour
Sub-pixel operators