ClassesClasses | | Operators

segment_contour_attrib_xldsegment_contour_attrib_xldSegmentContourAttribXldSegmentContourAttribXld (Operator)

Name

segment_contour_attrib_xldsegment_contour_attrib_xldSegmentContourAttribXldSegmentContourAttribXld — Segment XLD contour parts whose local attributes fulfill given conditions.

Signature

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

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)

Description

segment_contour_attrib_xldsegment_contour_attrib_xldSegmentContourAttribXldSegmentContourAttribXldSegmentContourAttribXld segments the contour in ContourContourContourContourcontour into contour parts ContourPartContourPartContourPartContourPartcontourPart. The segmentation of the contour depends on the values of its attributes AttributeAttributeAttributeAttributeattribute (see the possible values for AttributeAttributeAttributeAttributeattribute below). The operator checks which attribute values lie within the given limits (MinMinMinMinmin, MaxMaxMaxMaxmax) and returns the corresponding contour segments with its attributes in ContourPartContourPartContourPartContourPartcontourPart.

If OperationOperationOperationOperationoperation is set to 'and', each of the given attributes must lie within the limits. If OperationOperationOperationOperationoperation is set to 'or', at least one of the attributes has to be within the limits. The attributes are processed in the same order as they are given in AttributeAttributeAttributeAttributeattribute. If only one attribute is used, the value of OperationOperationOperationOperationoperation is ignored.

Note that not all attributes are defined in all contours per default. Which attributes are defined for a contour depends on how the contour was instantiated, and whether some operations have been previously performed on it. For example, the attributes 'width_right' and 'width_left' are only defined, if the contour was created with the operator lines_gausslines_gaussLinesGaussLinesGaussLinesGauss. Likewise, the attribute 'distance' is only present if the distances to some other contour was previously calculated with distance_contours_xlddistance_contours_xldDistanceContoursXldDistanceContoursXldDistanceContoursXld or apply_distance_transform_xldapply_distance_transform_xldApplyDistanceTransformXldApplyDistanceTransformXldApplyDistanceTransformXld.

Condition:

Possible values for AttributeAttributeAttributeAttributeattribute:

'edge_direction':

Edge direction (see edges_sub_pixedges_sub_pixEdgesSubPixEdgesSubPixEdgesSubPix for details)

'angle':

Angle of the direction perpendicular to the contour (see edges_sub_pixedges_sub_pixEdgesSubPixEdgesSubPixEdgesSubPix or lines_gausslines_gaussLinesGaussLinesGaussLinesGauss for details)

'response':

Magnitude of the second derivative (see edges_sub_pixedges_sub_pixEdgesSubPixEdgesSubPixEdgesSubPix or lines_gausslines_gaussLinesGaussLinesGaussLinesGauss for details)

'width_right':

Line width to the right of the line (see lines_gausslines_gaussLinesGaussLinesGaussLinesGauss for details)

'width_left':

Line width to the left of the line (see lines_gausslines_gaussLinesGaussLinesGaussLinesGauss for details)

'contrast':

Contrast of the line point (see lines_gausslines_gaussLinesGaussLinesGaussLinesGauss for details)

'asymmetry':

Asymmetry of the line point (see lines_gausslines_gaussLinesGaussLinesGaussLinesGauss for details)

'distance':

Minimal pointwise distance to a reference contour (see distance_contours_xlddistance_contours_xldDistanceContoursXldDistanceContoursXldDistanceContoursXld or apply_distance_transform_xldapply_distance_transform_xldApplyDistanceTransformXldApplyDistanceTransformXldApplyDistanceTransformXld for details)

Execution Information

Parameters

ContourContourContourContourcontour (input_object)  xld_cont(-array) objectHXLDContHXLDContHobject

Contour to be segmented.

ContourPartContourPartContourPartContourPartcontourPart (output_object)  xld_cont-array objectHXLDContHXLDContHobject *

Segmented contour parts.

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

Contour attributes to be checked.

Default value: 'distance' "distance" "distance" "distance" "distance"

List of values: '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*)

Linkage type of the individual attributes.

Default value: 'and' "and" "and" "and" "and"

List of values: '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*)

Lower limits of the attribute values.

Default value: 150.0

Typical range of values: 0.0 ≤ Min Min Min Min min ≤ 99999.0

Minimum increment: 0.001

Recommended increment: 1.0

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

Upper limits of the attribute values.

Default value: 99999.0

Typical range of values: 0.0 ≤ Max Max Max Max max ≤ 99999.0

Minimum increment: 0.001

Recommended increment: 1.0

Restriction: Max >= Min

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

Result

The operator segment_contour_attrib_xldsegment_contour_attrib_xldSegmentContourAttribXldSegmentContourAttribXldSegmentContourAttribXld returns the value 2 (H_MSG_TRUE) if the input is not empty. The behavior in case of empty input (no input objects available) is set via the operator 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>). If necessary, an exception is raised.

Possible Predecessors

lines_gausslines_gaussLinesGaussLinesGaussLinesGauss, edges_sub_pixedges_sub_pixEdgesSubPixEdgesSubPixEdgesSubPix, apply_distance_transform_xldapply_distance_transform_xldApplyDistanceTransformXldApplyDistanceTransformXldApplyDistanceTransformXld, distance_contours_xlddistance_contours_xldDistanceContoursXldDistanceContoursXldDistanceContoursXld

Possible Successors

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

See also

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

Module

Foundation


ClassesClasses | | Operators