ClassesClassesClassesClasses | | | | Operators

union_adjacent_contours_xldunion_adjacent_contours_xldUnionAdjacentContoursXldunion_adjacent_contours_xldUnionAdjacentContoursXldUnionAdjacentContoursXld (Operator)

Name

union_adjacent_contours_xldunion_adjacent_contours_xldUnionAdjacentContoursXldunion_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 UnionAdjacentContoursXld(const HObject& Contours, HObject* UnionContours, const HTuple& MaxDistAbs, const HTuple& MaxDistRel, const HTuple& Mode)

HXLDCont HXLDCont::UnionAdjacentContoursXld(double MaxDistAbs, double MaxDistRel, const HString& Mode) const

HXLDCont HXLDCont::UnionAdjacentContoursXld(double MaxDistAbs, double MaxDistRel, const char* 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_xldUnionAdjacentContoursXldunion_adjacent_contours_xldUnionAdjacentContoursXldUnionAdjacentContoursXld unifies all contours of the input XLD contour array (ContoursContoursContoursContoursContourscontours) 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 UnionContoursUnionContoursUnionContoursUnionContoursUnionContoursunionContours.

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

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 ModeModeModeModeModemode it is possible to control how to handle the attributes that may come with input contours. For example, the operator edges_sub_pixedges_sub_pixEdgesSubPixedges_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""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""attr_forget" has to be passed.

Parallelization

Parameters

ContoursContoursContoursContoursContourscontours (input_object)  xld_cont-array objectHXLDContHXLDContHXLDContArrayHXLDContXHobject

Input XLD contours.

UnionContoursUnionContoursUnionContoursUnionContoursUnionContoursunionContours (output_object)  xld_cont-array objectHXLDContHXLDContHXLDContArrayHXLDContXHobject *

Output XLD contours.

MaxDistAbsMaxDistAbsMaxDistAbsMaxDistAbsMaxDistAbsmaxDistAbs (input_control)  real HTupleHTupleHTupleVARIANTHtuple (real) (double) (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 maxDistAbs

MaxDistRelMaxDistRelMaxDistRelMaxDistRelMaxDistRelmaxDistRel (input_control)  real HTupleHTupleHTupleVARIANTHtuple (real) (double) (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 maxDistRel

ModeModeModeModeModemode (input_control)  string HTupleHTupleHTupleVARIANTHtuple (string) (string) (HString) (char*) (BSTR) (char*)

Mode describing the treatment of the contours' attributes.

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

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

Possible Predecessors

split_contours_xldsplit_contours_xldSplitContoursXldsplit_contours_xldSplitContoursXldSplitContoursXld, select_contours_xldselect_contours_xldSelectContoursXldselect_contours_xldSelectContoursXldSelectContoursXld

Alternatives

union_collinear_contours_xldunion_collinear_contours_xldUnionCollinearContoursXldunion_collinear_contours_xldUnionCollinearContoursXldUnionCollinearContoursXld, union_collinear_contours_ext_xldunion_collinear_contours_ext_xldUnionCollinearContoursExtXldunion_collinear_contours_ext_xldUnionCollinearContoursExtXldUnionCollinearContoursExtXld, union_cocircular_contours_xldunion_cocircular_contours_xldUnionCocircularContoursXldunion_cocircular_contours_xldUnionCocircularContoursXldUnionCocircularContoursXld, union_straight_contours_xldunion_straight_contours_xldUnionStraightContoursXldunion_straight_contours_xldUnionStraightContoursXldUnionStraightContoursXld, union_cotangential_contours_xldunion_cotangential_contours_xldUnionCotangentialContoursXldunion_cotangential_contours_xldUnionCotangentialContoursXldUnionCotangentialContoursXld

See also

edges_sub_pixedges_sub_pixEdgesSubPixedges_sub_pixEdgesSubPixEdgesSubPix, threshold_sub_pixthreshold_sub_pixThresholdSubPixthreshold_sub_pixThresholdSubPixThresholdSubPix, gen_polygons_xldgen_polygons_xldGenPolygonsXldgen_polygons_xldGenPolygonsXldGenPolygonsXld, split_contours_xldsplit_contours_xldSplitContoursXldsplit_contours_xldSplitContoursXldSplitContoursXld, select_contours_xldselect_contours_xldSelectContoursXldselect_contours_xldSelectContoursXldSelectContoursXld, get_contour_xldget_contour_xldGetContourXldget_contour_xldGetContourXldGetContourXld, get_contour_attrib_xldget_contour_attrib_xldGetContourAttribXldget_contour_attrib_xldGetContourAttribXldGetContourAttribXld

Module

Foundation


ClassesClassesClassesClasses | | | | Operators