gen_contours_skeleton_xld — 将骨架转换为 XLD 轮廓。
gen_contours_skeleton_xld converts the input skeleton
(e.g., edges) Skeleton, which is assumed to contain
mostly one pixel wide regions (see skeleton), into XLD
contours.
The algorithm first attempts to transform the regions to contain only line
segments in 8-neighborhood. In a second step, the junction points are
labeled. After this, gen_contours_skeleton_xld tries to generate
contours which end in junction or end points, in particular for junction
points of the following configurations (in all four possible
rotations):
1 0 1 1 0 1 1 0 0 1 0 0 0 1 0 0 1 0
0 2 0 0 2 0 0 2 1 0 2 1 0 2 1 1 2 1
0 0 1 1 0 1 0 1 0 1 0 0 0 1 0 0 1 0
where 0 = background, 1 = foreground, and 2 = junction point.
After this, all contours having at least Length points
are returned.
Since contours are split at junction points, possibly long contours
may be split into several short segments because of short adjacent
lines, even if they are longer than Length points, if
Mode = 'filter' was selected. This can be avoided by setting
Mode = 'generalize1'. In this case, the contours are
generated as if the segments shorter than Length were not
contained in the input region. In order to preserve line segments,
which are split into very short segments by the crossing of short
lines, Mode = 'generalize2' can be selected. In this
case, line segments are preserved if they end in two junction
points, even if they are shorter than Length。
Skeleton (输入对象) region → object
Skeleton of which the contours are to be determined.
Contours (输出对象) xld_cont-array → object
Resulting contours.
Length (输入控制) integer → (integer)
Minimum number of points a contour has to have.
默认值: 1
建议值: 1, 2, 3, 5, 10, 20
Mode (输入控制) string → (string)
Contour filter mode.
默认值: 'filter'
值列表: 'filter', 'generalize1', 'generalize2'
smooth_contours_xld,
get_contour_xld,
gen_polygons_xld
edges_image,
threshold,
get_region_contour
基础