split_skeleton_linesT_split_skeleton_linesSplitSkeletonLinesSplitSkeletonLinessplit_skeleton_lines (算子)

名称

split_skeleton_linesT_split_skeleton_linesSplitSkeletonLinesSplitSkeletonLinessplit_skeleton_lines — 拆分由一个像素宽的非分支线表示的线。

签名

split_skeleton_lines(SkeletonRegion : : MaxDistance : BeginRow, BeginCol, EndRow, EndCol)

Herror T_split_skeleton_lines(const Hobject SkeletonRegion, const Htuple MaxDistance, Htuple* BeginRow, Htuple* BeginCol, Htuple* EndRow, Htuple* EndCol)

void SplitSkeletonLines(const HObject& SkeletonRegion, const HTuple& MaxDistance, HTuple* BeginRow, HTuple* BeginCol, HTuple* EndRow, HTuple* EndCol)

void HRegion::SplitSkeletonLines(Hlong MaxDistance, HTuple* BeginRow, HTuple* BeginCol, HTuple* EndRow, HTuple* EndCol) const

static void HOperatorSet.SplitSkeletonLines(HObject skeletonRegion, HTuple maxDistance, out HTuple beginRow, out HTuple beginCol, out HTuple endRow, out HTuple endCol)

void HRegion.SplitSkeletonLines(int maxDistance, out HTuple beginRow, out HTuple beginCol, out HTuple endRow, out HTuple endCol)

def split_skeleton_lines(skeleton_region: HObject, max_distance: int) -> Tuple[Sequence[int], Sequence[int], Sequence[int], Sequence[int]]

描述

split_skeleton_linessplit_skeleton_linesSplitSkeletonLinesSplitSkeletonLinesSplitSkeletonLinessplit_skeleton_lines splits lines represented by one pixel wide, non-branching regions into shorter lines based on their curvature. A line is split if the maximum distance of a point on the line to the line segment connecting its end points is larger than MaxDistanceMaxDistanceMaxDistanceMaxDistancemaxDistancemax_distance (split & merge algorithm). The start and end points of the approximating line segments are returned in BeginRowBeginRowBeginRowBeginRowbeginRowbegin_row, BeginColBeginColBeginColBeginColbeginColbegin_col, EndRowEndRowEndRowEndRowendRowend_row, and EndColEndColEndColEndColendColend_col

注意

The input regions must represent non-branching lines, that is single branches of the skeleton.

执行信息

参数

SkeletonRegionSkeletonRegionSkeletonRegionSkeletonRegionskeletonRegionskeleton_region (输入对象)  region-array objectHRegionHObjectHRegionHobject

Input lines (represented by 1 pixel wide, non-branching regions).

MaxDistanceMaxDistanceMaxDistanceMaxDistancemaxDistancemax_distance (输入控制)  integer HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Maximum distance of the line points to the line segment connecting both end points.

默认值: 3

建议值: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10

值范围: 1 ≤ MaxDistance MaxDistance MaxDistance MaxDistance maxDistance max_distance ≤ 500 (lin)

最小增量: 1

建议增量: 1

BeginRowBeginRowBeginRowBeginRowbeginRowbegin_row (输出控制)  line.begin.y-array HTupleSequence[int]HTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Row coordinates of the start points of the output lines.

BeginColBeginColBeginColBeginColbeginColbegin_col (输出控制)  line.begin.x-array HTupleSequence[int]HTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Column coordinates of the start points of the output lines.

EndRowEndRowEndRowEndRowendRowend_row (输出控制)  line.end.y-array HTupleSequence[int]HTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Row coordinates of the end points of the output lines.

EndColEndColEndColEndColendColend_col (输出控制)  line.end.x-array HTupleSequence[int]HTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Column coordinates of the end points of the output lines.

示例(HDevelop)

read_image(Image,'fabrik')
edges_image (Image, ImaAmp, ImaDir, 'lanser2', 0.5, 'nms', 8, 16)
threshold (ImaAmp, RawEdges, 8, 255)
skeleton (RawEdges, Skeleton)
junctions_skeleton (Skeleton, EndPoints, JuncPoints)
difference (Skeleton, JuncPoints, SkelWithoutJunc)
connection (SkelWithoutJunc, SingleBranches)
select_shape (SingleBranches, SelectedBranches, 'area', 'and', 16, 99999)
split_skeleton_lines (SelectedBranches, 3, BeginRow, BeginCol, EndRow, \
                      EndCol)

示例(C)

read_image(&Image,"fabrik");
edges_image (Image, &ImaAmp, &ImaDir, "lanser2", 0.5, "nms", 8, 16);
threshold (ImaAmp, &RawEdges, 8, 255);
skeleton (RawEdges, &Skeleton);
junctions_skeleton (Skeleton, &EndPoints, &JuncPoints);
difference (Skeleton, JuncPoints, &SkelWithoutJunc);
connection (SkelWithoutJunc, &SingleBranches);
select_shape (SingleBranches, &SelectedBranches, "area", "and", 16, 99999);
split_skeleton_lines (SelectedBranches, 3, &BeginRow, &BeginCol, &EndRow,
                      &EndCol);

示例(HDevelop)

read_image(Image,'fabrik')
edges_image (Image, ImaAmp, ImaDir, 'lanser2', 0.5, 'nms', 8, 16)
threshold (ImaAmp, RawEdges, 8, 255)
skeleton (RawEdges, Skeleton)
junctions_skeleton (Skeleton, EndPoints, JuncPoints)
difference (Skeleton, JuncPoints, SkelWithoutJunc)
connection (SkelWithoutJunc, SingleBranches)
select_shape (SingleBranches, SelectedBranches, 'area', 'and', 16, 99999)
split_skeleton_lines (SelectedBranches, 3, BeginRow, BeginCol, EndRow, \
                      EndCol)

示例(HDevelop)

read_image(Image,'fabrik')
edges_image (Image, ImaAmp, ImaDir, 'lanser2', 0.5, 'nms', 8, 16)
threshold (ImaAmp, RawEdges, 8, 255)
skeleton (RawEdges, Skeleton)
junctions_skeleton (Skeleton, EndPoints, JuncPoints)
difference (Skeleton, JuncPoints, SkelWithoutJunc)
connection (SkelWithoutJunc, SingleBranches)
select_shape (SingleBranches, SelectedBranches, 'area', 'and', 16, 99999)
split_skeleton_lines (SelectedBranches, 3, BeginRow, BeginCol, EndRow, \
                      EndCol)

示例(HDevelop)

read_image(Image,'fabrik')
edges_image (Image, ImaAmp, ImaDir, 'lanser2', 0.5, 'nms', 8, 16)
threshold (ImaAmp, RawEdges, 8, 255)
skeleton (RawEdges, Skeleton)
junctions_skeleton (Skeleton, EndPoints, JuncPoints)
difference (Skeleton, JuncPoints, SkelWithoutJunc)
connection (SkelWithoutJunc, SingleBranches)
select_shape (SingleBranches, SelectedBranches, 'area', 'and', 16, 99999)
split_skeleton_lines (SelectedBranches, 3, BeginRow, BeginCol, EndRow, \
                      EndCol)

结果

split_skeleton_linessplit_skeleton_linesSplitSkeletonLinesSplitSkeletonLinesSplitSkeletonLinessplit_skeleton_lines 始终返回值 2 ( H_MSG_TRUE )。当输入为空(未指定区域)时则可设置行为通过 set_system('no_object_result',<Result>)set_system("no_object_result",<Result>)SetSystem("no_object_result",<Result>)SetSystem("no_object_result",<Result>)SetSystem("no_object_result",<Result>)set_system("no_object_result",<Result>),当输入区域为空时则设置行为通过 set_system('empty_region_result',<Result>)set_system("empty_region_result",<Result>)SetSystem("empty_region_result",<Result>)SetSystem("empty_region_result",<Result>)SetSystem("empty_region_result",<Result>)set_system("empty_region_result",<Result>),以及当结果区域为空时则设置行为通过 set_system('store_empty_region',<'true'/'false'>)set_system("store_empty_region",<"true"/"false">)SetSystem("store_empty_region",<"true"/"false">)SetSystem("store_empty_region",<"true"/"false">)SetSystem("store_empty_region",<"true"/"false">)set_system("store_empty_region",<"true"/"false">)。如有必要,则抛出异常。

可能的前趋

connectionconnectionConnectionConnectionConnectionconnection, select_shapeselect_shapeSelectShapeSelectShapeSelectShapeselect_shape, skeletonskeletonSkeletonSkeletonSkeletonskeleton, junctions_skeletonjunctions_skeletonJunctionsSkeletonJunctionsSkeletonJunctionsSkeletonjunctions_skeleton, differencedifferenceDifferenceDifferenceDifferencedifference

可能的后继

select_linesselect_linesSelectLinesSelectLinesSelectLinesselect_lines, partition_linespartition_linesPartitionLinesPartitionLinesPartitionLinespartition_lines, disp_linedisp_lineDispLineDispLineDispLinedisp_line

另见

split_skeleton_regionsplit_skeleton_regionSplitSkeletonRegionSplitSkeletonRegionSplitSkeletonRegionsplit_skeleton_region, detect_edge_segmentsdetect_edge_segmentsDetectEdgeSegmentsDetectEdgeSegmentsDetectEdgeSegmentsdetect_edge_segments

模块

基础