HALCON Reference Manual 10.0.2
Table of Contents / XLD / Transformations ClassesClassesClasses | | | Operators

union_adjacent_contours_xldunion_adjacent_contours_xldunion_adjacent_contours_xldUnionAdjacentContoursXldUnionAdjacentContoursXld (Operator)

Name

union_adjacent_contours_xldunion_adjacent_contours_xldunion_adjacent_contours_xldUnionAdjacentContoursXldUnionAdjacentContoursXld — Compute the union of contours whose end points are close together.

Signature

union_adjacent_contours_xld(Contours : UnionContours : MaxDistAbs, MaxDistRel, Mode : )

Herror union_adjacent_contours_xld(const Hobject Contours, Hobject* UnionContours, double MaxDistAbs, double MaxDistRel, const char* Mode)

Herror T_union_adjacent_contours_xld(const Hobject Contours, Hobject* UnionContours, const Htuple MaxDistAbs, const Htuple MaxDistRel, const Htuple Mode)

Herror union_adjacent_contours_xld(Hobject Contours, Hobject* UnionContours, const HTuple& MaxDistAbs, const HTuple& MaxDistRel, const HTuple& Mode)

HXLDContArray HXLDContArray::UnionAdjacentContoursXld(const HTuple& MaxDistAbs, const HTuple& MaxDistRel, const HTuple& Mode) const

void HOperatorSetX.UnionAdjacentContoursXld(
[in] IHUntypedObjectX* Contours, [out] IHUntypedObjectX*UnionContours, [in] VARIANT MaxDistAbs, [in] VARIANT MaxDistRel, [in] VARIANT Mode)

IHXLDContX* HXLDContX.UnionAdjacentContoursXld(
[in] double MaxDistAbs, [in] double MaxDistRel, [in] BSTR Mode)

static void HOperatorSet.UnionAdjacentContoursXld(HObject contours, out HObject unionContours, HTuple maxDistAbs, HTuple maxDistRel, HTuple mode)

HXLDCont HXLDCont.UnionAdjacentContoursXld(double maxDistAbs, double maxDistRel, string mode)

Description

The operator union_adjacent_contours_xldunion_adjacent_contours_xldunion_adjacent_contours_xldUnionAdjacentContoursXldUnionAdjacentContoursXld unifies all contours of the input XLD contour array (ContoursContoursContoursContourscontours) whose end points are close together. The unified contour consists of the concatenation of the contour points of the input contours. If necessary, the order of these input contour points is flipped, so that the end points of the contours that have to be connected are direct neighbors in the resulting point list. This operation is repeated until there are no more unconnected adjacent contours left. As a result all the contours that are newly created by unification, as well as the input contours that could not be connected with any other contour, are returned in UnionContoursUnionContoursUnionContoursUnionContoursunionContours.

The neighbored endpoints of two contours are connected if the distance between these end points neither exceeds an absolute threshold (MaxDistAbsMaxDistAbsMaxDistAbsMaxDistAbsmaxDistAbs) nor a relative threshold that is defined by the length of the longer contour multiplied by MaxDistRelMaxDistRelMaxDistRelMaxDistRelmaxDistRel.

The order for connecting adjacent contours depends mainly on the distance of the neighbored end points: the contours with the smallest distance are connected first. If there are two paires of contours with the same distance, first the contour pair that does not contain the shortest contour is connected.

Finally, by the parameter ModeModeModeModemode it is possible to control how to handle the attributes that may come with input contours. For example, the operator edges_sub_pixedges_sub_pixedges_sub_pixEdgesSubPixEdgesSubPix attaches to every contour point attributes like the local orientation, the edge response, and the edge direction. Choosing the default value 'attr_keep'"attr_keep""attr_keep""attr_keep""attr_keep", all attributes are copied to the output, and - if a contour has to be flipped for connecting it with another one - they are adapted to the new orientation. With a great number of input contours, however, it may be sensible to ignore the attributes for performance reasons, if they are not needed for further calculations. For this the value 'attr_forget'"attr_forget""attr_forget""attr_forget""attr_forget" has to be passed.

Parallelization

Parameters

ContoursContoursContoursContourscontours (input_object)  xld_cont-array objectHXLDContHXLDContArrayHXLDContXHobject

Input XLD contours.

UnionContoursUnionContoursUnionContoursUnionContoursunionContours (output_object)  xld_cont-array objectHXLDContHXLDContArrayHXLDContXHobject *

Output XLD contours.

MaxDistAbsMaxDistAbsMaxDistAbsMaxDistAbsmaxDistAbs (input_control)  real HTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double)

Maximum distance of the contours' end points.

Default value: 10.0

Typical range of values: 0.0 ≤ MaxDistAbs MaxDistAbs MaxDistAbs MaxDistAbs maxDistAbs

MaxDistRelMaxDistRelMaxDistRelMaxDistRelmaxDistRel (input_control)  real HTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double)

Maximum distance of the contours' end points in relation to the length of the longer contour.

Default value: 1.0

Typical range of values: 0.0 ≤ MaxDistRel MaxDistRel MaxDistRel MaxDistRel maxDistRel

ModeModeModeModemode (input_control)  string HTupleHTupleVARIANTHtuple (string) (string) (char*) (BSTR) (char*)

Mode describing the treatment of the contours' attributes.

Default value: 'attr_keep' "attr_keep" "attr_keep" "attr_keep" "attr_keep"

List of values: 'attr_keep'"attr_keep""attr_keep""attr_keep""attr_keep", 'attr_forget'"attr_forget""attr_forget""attr_forget""attr_forget"

Possible Predecessors

split_contours_xldsplit_contours_xldsplit_contours_xldSplitContoursXldSplitContoursXld, select_contours_xldselect_contours_xldselect_contours_xldSelectContoursXldSelectContoursXld

Alternatives

union_collinear_contours_xldunion_collinear_contours_xldunion_collinear_contours_xldUnionCollinearContoursXldUnionCollinearContoursXld, union_collinear_contours_ext_xldunion_collinear_contours_ext_xldunion_collinear_contours_ext_xldUnionCollinearContoursExtXldUnionCollinearContoursExtXld, union_cocircular_contours_xldunion_cocircular_contours_xldunion_cocircular_contours_xldUnionCocircularContoursXldUnionCocircularContoursXld, union_straight_contours_xldunion_straight_contours_xldunion_straight_contours_xldUnionStraightContoursXldUnionStraightContoursXld, union_cotangential_contours_xldunion_cotangential_contours_xldunion_cotangential_contours_xldUnionCotangentialContoursXldUnionCotangentialContoursXld

See also

edges_sub_pixedges_sub_pixedges_sub_pixEdgesSubPixEdgesSubPix, threshold_sub_pixthreshold_sub_pixthreshold_sub_pixThresholdSubPixThresholdSubPix, gen_polygons_xldgen_polygons_xldgen_polygons_xldGenPolygonsXldGenPolygonsXld, split_contours_xldsplit_contours_xldsplit_contours_xldSplitContoursXldSplitContoursXld, select_contours_xldselect_contours_xldselect_contours_xldSelectContoursXldSelectContoursXld, get_contour_xldget_contour_xldget_contour_xldGetContourXldGetContourXld, get_contour_attrib_xldget_contour_attrib_xldget_contour_attrib_xldGetContourAttribXldGetContourAttribXld

Module

Foundation


Table of Contents / XLD / Transformations ClassesClassesClasses | | | Operators
HALCON Reference Manual 10.0.2 Copyright © 1996-2011 MVTec Software GmbH