segment_contour_attrib_xldsegment_contour_attrib_xldSegmentContourAttribXldSegmentContourAttribXldsegment_contour_attrib_xld (Operator)

Name

segment_contour_attrib_xldsegment_contour_attrib_xldSegmentContourAttribXldSegmentContourAttribXldsegment_contour_attrib_xld — 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)

def segment_contour_attrib_xld(contour: HObject, attribute: MaybeSequence[str], operation: str, min: MaybeSequence[Union[int, float, str]], max: MaybeSequence[Union[int, float, str]]) -> HObject

Beschreibung

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

Ist OperationOperationOperationOperationoperationoperation auf 'and'"and""and""and""and""and" gesetzt, muss jedes der angegebenen Attribute innerhalb der vorgegebenen Grenzen liegen. Ist OperationOperationOperationOperationoperationoperation auf 'or'"or""or""or""or""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""min" beziehungsweise 'max'"max""max""max""max""max" für MinMinMinMinminmin und MaxMaxMaxMaxmaxmax gesetzt werden. Die Attribute werden in der Reihenfolge abgearbeitet, in der sie in AttributeAttributeAttributeAttributeattributeattribute aufgeführt sind. Wird nur ein Merkmal (AttributeAttributeAttributeAttributeattributeattribute) verwendet, wird der Wert von OperationOperationOperationOperationoperationoperation 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""width_right" und 'width_left'"width_left""width_left""width_left""width_left""width_left" nur vorhanden, wenn die Kontur mit dem Operator lines_gausslines_gaussLinesGaussLinesGaussLinesGausslines_gauss erzeugt wurde. Ebenso ist das Attribut 'distance'"distance""distance""distance""distance""distance" erst vorhanden, wenn zuvor der Abstand zu einer anderen Kontur mit distance_contours_xlddistance_contours_xldDistanceContoursXldDistanceContoursXldDistanceContoursXlddistance_contours_xld oder apply_distance_transform_xldapply_distance_transform_xldApplyDistanceTransformXldApplyDistanceTransformXldApplyDistanceTransformXldapply_distance_transform_xld berechnet wurde.

Bedingung:

Mögliche Werte für AttributeAttributeAttributeAttributeattributeattribute:

'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_xldGetContourAttribXldGetContourAttribXldGetContourAttribXldget_contour_attrib_xld.

Ausführungsinformationen

Parameter

ContourContourContourContourcontourcontour (input_object)  xld_cont(-array) objectHXLDContHObjectHXLDContHobject

Zu segmentierende Kontur.

ContourPartContourPartContourPartContourPartcontourPartcontour_part (output_object)  xld_cont-array objectHXLDContHObjectHXLDContHobject *

Kontursegmente.

AttributeAttributeAttributeAttributeattributeattribute (input_control)  string(-array) HTupleMaybeSequence[str]HTupleHtuple (string) (string) (HString) (char*)

Konturattribute, die geprüft werden.

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

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

OperationOperationOperationOperationoperationoperation (input_control)  string HTuplestrHTupleHtuple (string) (string) (HString) (char*)

Art der Verlinkung der individuellen Attribute.

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

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

MinMinMinMinminmin (input_control)  real(-array) HTupleMaybeSequence[Union[int, float, str]]HTupleHtuple (real / integer / string) (double / int / long / string) (double / Hlong / HString) (double / Hlong / char*)

Untere Grenze der Features.

Defaultwert: 150.0

Minimale Schrittweite: 0.001

Empfohlene Schrittweite: 1.0

MaxMaxMaxMaxmaxmax (input_control)  real(-array) HTupleMaybeSequence[Union[int, float, str]]HTupleHtuple (real / integer / string) (double / int / long / string) (double / Hlong / HString) (double / Hlong / char*)

Obere Grenze der Features.

Defaultwert: 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_shapeSelectShapeSelectShapeSelectShapeselect_shape 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>)set_system("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>)set_system("empty_region_result",<Result>) bestimmt. Gegebenenfalls wird eine Fehlerbehandlung durchgeführt.

Vorgänger

lines_gausslines_gaussLinesGaussLinesGaussLinesGausslines_gauss, edges_sub_pixedges_sub_pixEdgesSubPixEdgesSubPixEdgesSubPixedges_sub_pix, apply_distance_transform_xldapply_distance_transform_xldApplyDistanceTransformXldApplyDistanceTransformXldApplyDistanceTransformXldapply_distance_transform_xld, distance_contours_xlddistance_contours_xldDistanceContoursXldDistanceContoursXldDistanceContoursXlddistance_contours_xld

Nachfolger

fit_line_contour_xldfit_line_contour_xldFitLineContourXldFitLineContourXldFitLineContourXldfit_line_contour_xld, fit_ellipse_contour_xldfit_ellipse_contour_xldFitEllipseContourXldFitEllipseContourXldFitEllipseContourXldfit_ellipse_contour_xld, fit_circle_contour_xldfit_circle_contour_xldFitCircleContourXldFitCircleContourXldFitCircleContourXldfit_circle_contour_xld, fit_rectangle2_contour_xldfit_rectangle2_contour_xldFitRectangle2ContourXldFitRectangle2ContourXldFitRectangle2ContourXldfit_rectangle2_contour_xld

Siehe auch

split_contours_xldsplit_contours_xldSplitContoursXldSplitContoursXldSplitContoursXldsplit_contours_xld, get_contour_global_attrib_xldget_contour_global_attrib_xldGetContourGlobalAttribXldGetContourGlobalAttribXldGetContourGlobalAttribXldget_contour_global_attrib_xld, query_contour_attribs_xldquery_contour_attribs_xldQueryContourAttribsXldQueryContourAttribsXldQueryContourAttribsXldquery_contour_attribs_xld, get_contour_attrib_xldget_contour_attrib_xldGetContourAttribXldGetContourAttribXldGetContourAttribXldget_contour_attrib_xld

Modul

Foundation