split_skeleton_regionsplit_skeleton_regionSplitSkeletonRegionSplitSkeletonRegionsplit_skeleton_region (Operator)

Name

split_skeleton_regionsplit_skeleton_regionSplitSkeletonRegionSplitSkeletonRegionsplit_skeleton_region — Split lines represented by one pixel wide, non-branching regions.

Signature

split_skeleton_region(SkeletonRegion : RegionLines : MaxDistance : )

Herror split_skeleton_region(const Hobject SkeletonRegion, Hobject* RegionLines, const Hlong MaxDistance)

Herror T_split_skeleton_region(const Hobject SkeletonRegion, Hobject* RegionLines, const Htuple MaxDistance)

void SplitSkeletonRegion(const HObject& SkeletonRegion, HObject* RegionLines, const HTuple& MaxDistance)

HRegion HRegion::SplitSkeletonRegion(Hlong MaxDistance) const

static void HOperatorSet.SplitSkeletonRegion(HObject skeletonRegion, out HObject regionLines, HTuple maxDistance)

HRegion HRegion.SplitSkeletonRegion(int maxDistance)

def split_skeleton_region(skeleton_region: HObject, max_distance: int) -> HObject

Description

split_skeleton_regionsplit_skeleton_regionSplitSkeletonRegionSplitSkeletonRegionSplitSkeletonRegionsplit_skeleton_region 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). However, not the approximating lines are returned, but rather the original lines split into several output regions.

Attention

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

Execution Information

Parameters

SkeletonRegionSkeletonRegionSkeletonRegionSkeletonRegionskeletonRegionskeleton_region (input_object)  region(-array) objectHRegionHObjectHRegionHobject

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

RegionLinesRegionLinesRegionLinesRegionLinesregionLinesregion_lines (output_object)  region-array objectHRegionHObjectHRegionHobject *

Split lines.

MaxDistanceMaxDistanceMaxDistanceMaxDistancemaxDistancemax_distance (input_control)  integer HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

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

Default value: 3

Suggested values: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10

Typical range of values: 1 ≤ MaxDistance MaxDistance MaxDistance MaxDistance maxDistance max_distance ≤ 500 (lin)

Minimum increment: 1

Recommended increment: 1

Example (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_region (SelectedBranches, Lines, 3)

Example (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_region (SelectedBranches, Lines, 3);

Example (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_region (SelectedBranches, Lines, 3)

Example (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_region (SelectedBranches, Lines, 3)

Example (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_region (SelectedBranches, Lines, 3)

Result

split_skeleton_regionsplit_skeleton_regionSplitSkeletonRegionSplitSkeletonRegionSplitSkeletonRegionsplit_skeleton_region always returns the value TRUE. The behavior in case of empty input (no regions given) can be set via 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>), the behavior in case of an empty input region via 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>), and the behavior in case of an empty result region via set_system('store_empty_region',<'2 (H_MSG_TRUE)'/'3 (H_MSG_FALSE)'>)set_system("store_empty_region",<"2 (H_MSG_TRUE)"/"3 (H_MSG_FALSE)">)SetSystem("store_empty_region",<"2 (H_MSG_TRUE)"/"3 (H_MSG_FALSE)">)SetSystem("store_empty_region",<"2 (H_MSG_TRUE)"/"3 (H_MSG_FALSE)">)SetSystem("store_empty_region",<"2 (H_MSG_TRUE)"/"3 (H_MSG_FALSE)">)set_system("store_empty_region",<"2 (H_MSG_TRUE)"/"3 (H_MSG_FALSE)">). If necessary, an exception is raised.

Possible Predecessors

connectionconnectionConnectionConnectionConnectionconnection, select_shapeselect_shapeSelectShapeSelectShapeSelectShapeselect_shape, skeletonskeletonSkeletonSkeletonSkeletonskeleton, junctions_skeletonjunctions_skeletonJunctionsSkeletonJunctionsSkeletonJunctionsSkeletonjunctions_skeleton, differencedifferenceDifferenceDifferenceDifferencedifference

Possible Successors

count_objcount_objCountObjCountObjCountObjcount_obj, select_shapeselect_shapeSelectShapeSelectShapeSelectShapeselect_shape, select_objselect_objSelectObjSelectObjSelectObjselect_obj, area_centerarea_centerAreaCenterAreaCenterAreaCenterarea_center, elliptic_axiselliptic_axisEllipticAxisEllipticAxisEllipticAxiselliptic_axis, smallest_rectangle2smallest_rectangle2SmallestRectangle2SmallestRectangle2SmallestRectangle2smallest_rectangle2, get_region_polygonget_region_polygonGetRegionPolygonGetRegionPolygonGetRegionPolygonget_region_polygon, get_region_contourget_region_contourGetRegionContourGetRegionContourGetRegionContourget_region_contour

See also

split_skeleton_linessplit_skeleton_linesSplitSkeletonLinesSplitSkeletonLinesSplitSkeletonLinessplit_skeleton_lines, get_region_polygonget_region_polygonGetRegionPolygonGetRegionPolygonGetRegionPolygonget_region_polygon, gen_polygons_xldgen_polygons_xldGenPolygonsXldGenPolygonsXldGenPolygonsXldgen_polygons_xld

Module

Foundation