Skip to content

split_skeleton_linesSplitSkeletonLinesSplitSkeletonLinessplit_skeleton_linesT_split_skeleton_lines🔗

説明🔗

split_skeleton_linesSplitSkeletonLinesSplitSkeletonLinessplit_skeleton_linesT_split_skeleton_lines — 1 ピクセル幅で枝分かれが無いラインを分割する。

書式🔗

split_skeleton_lines( region SkeletonRegion, integer MaxDistance, out line.begin.y BeginRow, out line.begin.x BeginCol, out line.end.y EndRow, out line.end.x EndCol )void SplitSkeletonLines( const HObject& SkeletonRegion, const HTuple& MaxDistance, HTuple* BeginRow, HTuple* BeginCol, HTuple* EndRow, HTuple* EndCol )static void HOperatorSet.SplitSkeletonLines( HObject skeletonRegion, HTuple 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]]

Herror T_split_skeleton_lines( 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

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

説明🔗

split_skeleton_linesSplitSkeletonLines は、1 つのピクセル幅で枝分かれのない 領域によって表現されたラインを、それらの湾曲に基づいてより短いライ ンへ分割します。その端点に接続したラインセグメントへのライン上の点 の最大距離が MaxDistancemaxDistancemax_distance より大きい場合にラインは分割さ れます(分割結合アルゴリズム)。近似ラインセグメントの開始点と終了 点は、BeginRowbeginRowbegin_row、BeginColbeginColbegin_col、EndRowendRowend_row、およ び EndColendColend_col 内に格納されます。

注意🔗

入力領域は枝分かれの無いラインを表現しなければなりません。

実行情報🔗

実行情報
  • マルチスレッドタイプ: リエントラント(非排他なオペレーターと並列に動作)

  • マルチスレッドスコープ: グローバル(他のスレッドから呼び出される可能性あり)

  • tupleレベルで自動的に並列演算処理を実施

パラメーター🔗

SkeletonRegionskeletonRegionskeleton_region (input_object) region-array → objectHObjectHRegionHObjectHobject

入力ライン (1 ピクセル幅で枝分かれの無い領域によって 表現されたライン)

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

両方の端点を接続するラインセグメントへのライン点の最 大距離

初期値: 33
推奨値: 1, 2, 3, 4, 5, 6, 7, 8, 9, 101, 2, 3, 4, 5, 6, 7, 8, 9, 10
値域: 1 ≤ MaxDistance ≤ 500 (lin)
最小増分: 1
推奨増分: 1

BeginRowbeginRowbegin_row (output_control) line.begin.y-array → (integer)HTuple (Hlong)HTuple (int / long)Sequence[int]Htuple (Hlong)

出力ラインの開始点の行座標

BeginColbeginColbegin_col (output_control) line.begin.x-array → (integer)HTuple (Hlong)HTuple (int / long)Sequence[int]Htuple (Hlong)

出力ラインの開始点の列座標

EndRowendRowend_row (output_control) line.end.y-array → (integer)HTuple (Hlong)HTuple (int / long)Sequence[int]Htuple (Hlong)

出力ラインの終了点の行座標

EndColendColend_col (output_control) line.end.x-array → (integer)HTuple (Hlong)HTuple (int / long)Sequence[int]Htuple (Hlong)

出力ラインの終了点の列座標

例🔗

(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)\;

結果🔗

split_skeleton_linesSplitSkeletonLines は、常に値 2 (H_MSG_TRUE) を返します。空入力( 領域が存在しない)の場合は、 set_system('no_object_result',<Result>) から設定することが できます。空の入力領域である場合は、 set_system('empty_region_result',<Result>) から設定するこ とができます。また、空の結果領域である場合は、 set_system('store_empty_region',<'true'/'false'>) から設定する ことができます。 必要に応じて、例外が発生します。

他のオペレーターとの組み合わせ🔗

組み合わせ

前処理の候補

connectionConnection, select_shapeSelectShape, skeletonSkeleton, junctions_skeletonJunctionsSkeleton, differenceDifference

後処理の候補

select_linesSelectLines, partition_linesPartitionLines, disp_lineDispLine

関連項目

split_skeleton_regionSplitSkeletonRegion, detect_edge_segmentsDetectEdgeSegments

モジュール🔗

Foundation