segment_contour_attrib_xldsegment_contour_attrib_xldSegmentContourAttribXldSegmentContourAttribXld (Operator)

Name

segment_contour_attrib_xldsegment_contour_attrib_xldSegmentContourAttribXldSegmentContourAttribXld — Segmentieren von Konturteilen, deren Attribute vorgegebene Bedingungen erfüllen.

Signatur

segment_contour_attrib_xld(Contour : ContourPart : Attribute, Operation, Min, Max : )

Herror segment_contour_attrib_xld(const Hobject Contour, Hobject* ContourPart, const char* Attribute, const char* Operation, double Min, double Max)

Herror T_segment_contour_attrib_xld(const Hobject Contour, Hobject* ContourPart, const Htuple Attribute, const Htuple Operation, const Htuple Min, const Htuple Max)

void SegmentContourAttribXld(const HObject& Contour, HObject* ContourPart, const HTuple& Attribute, const HTuple& Operation, const HTuple& Min, const HTuple& Max)

HXLDCont HXLDCont::SegmentContourAttribXld(const HTuple& Attribute, const HString& Operation, const HTuple& Min, const HTuple& Max) const

HXLDCont HXLDCont::SegmentContourAttribXld(const HString& Attribute, const HString& Operation, double Min, double Max) const

HXLDCont HXLDCont::SegmentContourAttribXld(const char* Attribute, const char* Operation, double Min, double Max) const

HXLDCont HXLDCont::SegmentContourAttribXld(const wchar_t* Attribute, const wchar_t* Operation, double Min, double Max) const   (Nur Windows)

static void HOperatorSet.SegmentContourAttribXld(HObject contour, out HObject contourPart, HTuple attribute, HTuple operation, HTuple min, HTuple max)

HXLDCont HXLDCont.SegmentContourAttribXld(HTuple attribute, string operation, HTuple min, HTuple max)

HXLDCont HXLDCont.SegmentContourAttribXld(string attribute, string operation, double min, double max)

Beschreibung

segment_contour_attrib_xldsegment_contour_attrib_xldSegmentContourAttribXldSegmentContourAttribXldSegmentContourAttribXld segmentiert die Eingabekontur ContourContourContourContourcontour in Kontursegmente ContourPartContourPartContourPartContourPartcontourPart. Die Segmentierung der Kontur ist von den Werten der Konturattribute AttributeAttributeAttributeAttributeattribute abhängig (siehe unten für mögliche Werte von AttributeAttributeAttributeAttributeattribute). Der Operator prüft welche Attributwerte innerhalb der vorgegebenen Grenzen (MinMinMinMinmin, MaxMaxMaxMaxmax) liegen und liefert die entsprechenden Kontursegmente zusammen mit ihren Attributen in ContourPartContourPartContourPartContourPartcontourPart zurück.

Ist OperationOperationOperationOperationoperation auf 'and' gesetzt, muss jedes der angegebenen Attribute innerhalb der vorgegebenen Grenzen liegen. Ist OperationOperationOperationOperationoperation auf 'or' gesetzt, muss mindestens ein Attribut innerhalb der vorgegebenen Grenzen liegen. Um diese Grenzen nach unten oder oben offen zu lassen, kann statt eines Wertes auch 'min'"min""min""min""min" beziehungsweise 'max'"max""max""max""max" für MinMinMinMinmin und MaxMaxMaxMaxmax gesetzt werden. Die Attribute werden in der Reihenfolge abgearbeitet, in der sie in AttributeAttributeAttributeAttributeattribute aufgeführt sind. Wird nur ein Merkmal (AttributeAttributeAttributeAttributeattribute) verwendet, wird der Wert von OperationOperationOperationOperationoperation ignoriert.

Es ist zu beachten, dass nicht alle Attribute in jeder Kontur vorhanden sind. Welche Attribute für eine gegebene Kontur definiert sind, hängt davon ab, wie die Kontur erzeugt wurde und ob bestimmte Operationen darauf ausgeführt wurden. So sind zum Beispiel die Attribute 'width_right'"width_right""width_right""width_right""width_right" und 'width_left'"width_left""width_left""width_left""width_left" nur vorhanden, wenn die Kontur mit dem Operator lines_gausslines_gaussLinesGaussLinesGaussLinesGauss erzeugt wurde. Ebenso ist das Attribut 'distance'"distance""distance""distance""distance" erst vorhanden, wenn zuvor der Abstand zu einer anderen Kontur mit distance_contours_xlddistance_contours_xldDistanceContoursXldDistanceContoursXldDistanceContoursXld oder apply_distance_transform_xldapply_distance_transform_xldApplyDistanceTransformXldApplyDistanceTransformXldApplyDistanceTransformXld berechnet wurde.

Bedingung:

Mögliche Werte für AttributeAttributeAttributeAttributeattribute:

'edge_direction':

Kantenrichtung

'angle':

Der Winkel der Richtung senkrecht zur Linie

'response':

Die Größe der zweiten Ableitung

'width_right':

Die Linienbreite rechts von der Linie

'width_left':

Die Linienbreite links von der Linie

'contrast':

Der Kontrast des Linienpunkts

'asymmetry':

Die Asymmetrie des Linienpunkts

'distance':

Der minimale punktweise Abstand zu einer Referenzkontur

Welche Operatoren einer Kontur die oben genannten Attribute hinzufügen und weitere Informationen zu den Attributen finden sich in get_contour_attrib_xldget_contour_attrib_xldGetContourAttribXldGetContourAttribXldGetContourAttribXld.

Ausführungsinformationen

Parameter

ContourContourContourContourcontour (input_object)  xld_cont(-array) objectHXLDContHXLDContHobject

Zu segmentierende Kontur.

ContourPartContourPartContourPartContourPartcontourPart (output_object)  xld_cont-array objectHXLDContHXLDContHobject *

Kontursegmente.

AttributeAttributeAttributeAttributeattribute (input_control)  string(-array) HTupleHTupleHtuple (string) (string) (HString) (char*)

Konturattribute, die geprüft werden.

Defaultwert: 'distance' "distance" "distance" "distance" "distance"

Werteliste: 'angle'"angle""angle""angle""angle", 'asymmetry'"asymmetry""asymmetry""asymmetry""asymmetry", 'contrast'"contrast""contrast""contrast""contrast", 'distance'"distance""distance""distance""distance", 'edge_direction'"edge_direction""edge_direction""edge_direction""edge_direction", 'response'"response""response""response""response", 'width_left'"width_left""width_left""width_left""width_left", 'width_right'"width_right""width_right""width_right""width_right"

OperationOperationOperationOperationoperation (input_control)  string HTupleHTupleHtuple (string) (string) (HString) (char*)

Art der Verlinkung der individuellen Attribute.

Defaultwert: 'and' "and" "and" "and" "and"

Werteliste: 'and'"and""and""and""and", 'or'"or""or""or""or"

MinMinMinMinmin (input_control)  real(-array) HTupleHTupleHtuple (real / integer / string) (double / int / long / string) (double / Hlong / HString) (double / Hlong / char*)

Untere Grenze der Features.

Defaultwert: 150.0

Typischer Wertebereich: 0.0 ≤ Min Min Min Min min ≤ 99999.0

Minimale Schrittweite: 0.001

Empfohlene Schrittweite: 1.0

MaxMaxMaxMaxmax (input_control)  real(-array) HTupleHTupleHtuple (real / integer / string) (double / int / long / string) (double / Hlong / HString) (double / Hlong / char*)

Obere Grenze der Features.

Defaultwert: 99999.0

Typischer Wertebereich: 0.0 ≤ Max Max Max Max max ≤ 99999.0

Minimale Schrittweite: 0.001

Empfohlene Schrittweite: 1.0

Restriktion: Max >= Min

Beispiel (HDevelop)

read_image (Image, 'fabrik')
edges_sub_pix (Image, Edges, 'canny', 1, 20, 40)
* select 'vertical' edges:
segment_contour_attrib_xld (Edges, ContourPart, 'edge_direction', \
                            'and', rad(90-20), rad(90+20))

Ergebnis

select_shapeselect_shapeSelectShapeSelectShapeSelectShape liefert den Wert 2 (H_MSG_TRUE), falls die Eingabe nicht leer ist. Das Verhalten bei leerer Eingabe (keine Eingabeobjekte 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>) festlegen. Das Verhalten bei einer leeren Region (Region ist die leere Menge) wird 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>) bestimmt. Gegebenenfalls wird eine Fehlerbehandlung durchgeführt.

Vorgänger

lines_gausslines_gaussLinesGaussLinesGaussLinesGauss, edges_sub_pixedges_sub_pixEdgesSubPixEdgesSubPixEdgesSubPix, apply_distance_transform_xldapply_distance_transform_xldApplyDistanceTransformXldApplyDistanceTransformXldApplyDistanceTransformXld, distance_contours_xlddistance_contours_xldDistanceContoursXldDistanceContoursXldDistanceContoursXld

Nachfolger

fit_line_contour_xldfit_line_contour_xldFitLineContourXldFitLineContourXldFitLineContourXld, fit_ellipse_contour_xldfit_ellipse_contour_xldFitEllipseContourXldFitEllipseContourXldFitEllipseContourXld, fit_circle_contour_xldfit_circle_contour_xldFitCircleContourXldFitCircleContourXldFitCircleContourXld, fit_rectangle2_contour_xldfit_rectangle2_contour_xldFitRectangle2ContourXldFitRectangle2ContourXldFitRectangle2ContourXld

Siehe auch

split_contours_xldsplit_contours_xldSplitContoursXldSplitContoursXldSplitContoursXld, get_contour_global_attrib_xldget_contour_global_attrib_xldGetContourGlobalAttribXldGetContourGlobalAttribXldGetContourGlobalAttribXld, query_contour_attribs_xldquery_contour_attribs_xldQueryContourAttribsXldQueryContourAttribsXldQueryContourAttribsXld, get_contour_attrib_xldget_contour_attrib_xldGetContourAttribXldGetContourAttribXldGetContourAttribXld

Modul

Foundation