Skip to content

split_skeleton_regionSplitSkeletonRegionSplitSkeletonRegionsplit_skeleton_regionsplit_skeleton_region🔗

Short description🔗

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

Signature🔗

split_skeleton_region( region SkeletonRegion, out region RegionLines, integer MaxDistance )void SplitSkeletonRegion( const HObject& SkeletonRegion, HObject* RegionLines, const HTuple& MaxDistance )static void HOperatorSet.SplitSkeletonRegion( HObject skeletonRegion, out HObject regionLines, HTuple maxDistance )def split_skeleton_region( skeleton_region: HObject, max_distance: int ) -> HObject

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 )

HRegion HRegion::SplitSkeletonRegion( Hlong MaxDistance ) const

HRegion HRegion.SplitSkeletonRegion( int maxDistance )

Description🔗

split_skeleton_regionSplitSkeletonRegion 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 MaxDistancemaxDistancemax_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🔗

Execution information
  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).

  • Multithreading scope: global (may be called from any thread).

  • Automatically parallelized on tuple level.

Parameters🔗

SkeletonRegionskeletonRegionskeleton_region (input_object) region(-array) → objectHObjectHRegionHObjectHobject

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

RegionLinesregionLinesregion_lines (output_object) region-array → objectHObjectHRegionHObjectHobject *

Split lines.

MaxDistancemaxDistancemax_distance (input_control) integer → (integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

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

Default: 33
Suggested values: 1, 2, 3, 4, 5, 6, 7, 8, 9, 101, 2, 3, 4, 5, 6, 7, 8, 9, 10
Value range: 1 ≤ MaxDistance ≤ 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)
(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)\;

Result🔗

split_skeleton_regionSplitSkeletonRegion always returns the value 2 (H_MSG_TRUE). The behavior in case of empty input (no regions given) can be set via set_system('no_object_result',<Result>), the behavior in case of an empty input region via set_system('empty_region_result',<Result>), and the behavior in case of an empty result region via set_system('store_empty_region',<'true'/'false'>). If necessary, an exception is raised.

Combinations with other operators🔗

Combinations

Possible predecessors

connectionConnection, select_shapeSelectShape, skeletonSkeleton, junctions_skeletonJunctionsSkeleton, differenceDifference

Possible successors

count_objCountObj, select_shapeSelectShape, select_objSelectObj, area_centerAreaCenter, elliptic_axisEllipticAxis, smallest_rectangle2SmallestRectangle2, get_region_polygonGetRegionPolygon, get_region_contourGetRegionContour

See also

split_skeleton_linesSplitSkeletonLines, get_region_polygonGetRegionPolygon, gen_polygons_xldGenPolygonsXld

Module🔗

Foundation