split_skeleton_linesT_split_skeleton_linesSplitSkeletonLinesSplitSkeletonLines (Operator)

Name

split_skeleton_linesT_split_skeleton_linesSplitSkeletonLinesSplitSkeletonLines — Auftrennen von Linien (codiert durch 1 Pixel breite unverzweigte Linien).

Signatur

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)

Beschreibung

split_skeleton_linessplit_skeleton_linesSplitSkeletonLinesSplitSkeletonLinesSplitSkeletonLines trennt Eingabelinien (codiert durch 1 Pixel breite unverzweigte Regionen) gemäß ihrer Krümmung in Teillinien auf. Eine Linie wird dabei aufgetrennt, wenn der maximale Abstand eines Linienpunktes von der Verbindungsgeraden zwischen Anfangs- und Endpunkt der Linie größer als MaxDistanceMaxDistanceMaxDistanceMaxDistancemaxDistance ist (Split & Merge Algorithmus). Zurückgeliefert wird dann die Geradenapproximation (Anfangs- und Endpunkte) an die Eingabelinie.

Achtung

Die Eingaberegionen müssen unverzweigte Linien codieren, also einzelne Äste des Skeletts.

Ausführungsinformationen

Parameter

SkeletonRegionSkeletonRegionSkeletonRegionSkeletonRegionskeletonRegion (input_object)  region-array objectHRegionHRegionHobject

Eingabelinien (codiert als 1 Pixel breite unverzweigte Regionen).

MaxDistanceMaxDistanceMaxDistanceMaxDistancemaxDistance (input_control)  integer HTupleHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Krümmungsmaß (max. Abstand der Linienpunkte von der Verbindungsgeraden zwischen Anfangs- und Endpunkt).

Defaultwert: 3

Wertevorschläge: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10

Typischer Wertebereich: 1 ≤ MaxDistance MaxDistance MaxDistance MaxDistance maxDistance ≤ 500 (lin)

Minimale Schrittweite: 1

Empfohlene Schrittweite: 1

BeginRowBeginRowBeginRowBeginRowbeginRow (output_control)  line.begin.y-array HTupleHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Zeilenkoordinaten der Anfangspunkte der Ausgabelinien.

BeginColBeginColBeginColBeginColbeginCol (output_control)  line.begin.x-array HTupleHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Spaltenkoordinaten der Anfangspunkte der Ausgabelinien.

EndRowEndRowEndRowEndRowendRow (output_control)  line.end.y-array HTupleHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Zeilenkoordinaten der Endpunkte der Ausgabelinien.

EndColEndColEndColEndColendCol (output_control)  line.end.x-array HTupleHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Spaltenkoordinaten der Endpunkte der Ausgabelinien.

Beispiel (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)

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

Beispiel (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)

Beispiel (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)

Beispiel (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)

Ergebnis

split_skeleton_linessplit_skeleton_linesSplitSkeletonLinesSplitSkeletonLinesSplitSkeletonLines liefert normalerweise den Wert 2 (H_MSG_TRUE). Das Verhalten bei leerer Eingabe (keine Eingabebilder vorhanden) lässt sich mittels 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>), das bei leerer Region mit 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>), und das bei leerer Ergebnisregion mit 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">) festlegen. Gegebenenfalls wird eine Fehlerbehandlung durchgeführt.

Vorgänger

connectionconnectionConnectionConnectionConnection, select_shapeselect_shapeSelectShapeSelectShapeSelectShape, skeletonskeletonSkeletonSkeletonSkeleton, junctions_skeletonjunctions_skeletonJunctionsSkeletonJunctionsSkeletonJunctionsSkeleton, differencedifferenceDifferenceDifferenceDifference

Nachfolger

select_linesselect_linesSelectLinesSelectLinesSelectLines, partition_linespartition_linesPartitionLinesPartitionLinesPartitionLines, disp_linedisp_lineDispLineDispLineDispLine

Siehe auch

split_skeleton_regionsplit_skeleton_regionSplitSkeletonRegionSplitSkeletonRegionSplitSkeletonRegion, detect_edge_segmentsdetect_edge_segmentsDetectEdgeSegmentsDetectEdgeSegmentsDetectEdgeSegments

Modul

Foundation