ClassesClasses | | Operators

union2_closed_contours_xldunion2_closed_contours_xldUnion2ClosedContoursXldUnion2ClosedContoursXld (Operator)

Name

union2_closed_contours_xldunion2_closed_contours_xldUnion2ClosedContoursXldUnion2ClosedContoursXld — Compute the union of closed contours.

Signature

union2_closed_contours_xld(Contours1, Contours2 : ContoursUnion : : )

Herror union2_closed_contours_xld(const Hobject Contours1, const Hobject Contours2, Hobject* ContoursUnion)

Herror T_union2_closed_contours_xld(const Hobject Contours1, const Hobject Contours2, Hobject* ContoursUnion)

void Union2ClosedContoursXld(const HObject& Contours1, const HObject& Contours2, HObject* ContoursUnion)

HXLDCont HXLDCont::Union2ClosedContoursXld(const HXLDCont& Contours2) const

static void HOperatorSet.Union2ClosedContoursXld(HObject contours1, HObject contours2, out HObject contoursUnion)

HXLDCont HXLDCont.Union2ClosedContoursXld(HXLDCont contours2)

Description

The operator union2_closed_contours_xldunion2_closed_contours_xldUnion2ClosedContoursXldUnion2ClosedContoursXldUnion2ClosedContoursXld calculates the union of the regions enclosed by the contours Contours1Contours1Contours1Contours1contours1 and Contours2Contours2Contours2Contours2contours2. The boundaries of this union are returned in ContoursUnionContoursUnionContoursUnionContoursUnioncontoursUnion.

If the individual input contours are not closed, they are closed automatically by connecting their start and end points.

Internally, first, the regions enclosed by each set of contours (Contours1Contours1Contours1Contours1contours1 and Contours2Contours2Contours2Contours2contours2, respectively) are determined as described below. Then, the union of these two regions is calculated.

In the following, the two sets of input contours are referred to as boundary sets. A boundary set consists of an arbitrary number of boundaries (the individual contours of Contours1Contours1Contours1Contours1contours1 and Contours2Contours2Contours2Contours2contours2, respectively). Each boundary may be convex or concave and self-intersecting. Internal holes may be formed by the nesting of boundaries.

The region enclosed by such a boundary set is defined by the so-called Even-Odd-Rule. Thus, it consists of all points with the following property: The line constructed by connecting the point with another reference point that lies outside of the region has an odd number of intersections with boundaries.

More descriptive, this means that a boundary defines a hole in the region enclosed by another boundary if it lies completely inside that region. Similarly, the overlapping area of two separate boundaries of one boundary set is taken as a "hole", i.e., it does not belong to the region enclosed by the two boundaries. Note that the region enclosed by a boundary does not depend on the orientation of the boundary.

A self-intersecting boundary may be split at the intersection point or it is reordered such that it touches itself at the intersection point. The resulting boundaries are treated as separate boundaries.

The resulting boundaries ContoursUnionContoursUnionContoursUnionContoursUnioncontoursUnion are automatically classified into boundaries that enclose regions and boundaries that enclose holes. This information is stored in the global contour attribute 'is_hole'"is_hole""is_hole""is_hole""is_hole". For boundaries that enclose holes, the global contour attribute 'is_hole'"is_hole""is_hole""is_hole""is_hole" is set to 1. Otherwise, it is set to 0.

Note that subsequent points whose row and column coordinates differ by less than 1e-06 pixels are considered as one point.

Execution Information

Parameters

Contours1Contours1Contours1Contours1contours1 (input_object)  xld_cont(-array) objectHXLDContHXLDContHobject

Contours enclosing the first region.

Contours2Contours2Contours2Contours2contours2 (input_object)  xld_cont(-array) objectHXLDContHXLDContHobject

Contours enclosing the second region.

ContoursUnionContoursUnionContoursUnionContoursUnioncontoursUnion (output_object)  xld_cont(-array) objectHXLDContHXLDContHobject *

Contours enclosing the union.

Result

union2_closed_contours_xldunion2_closed_contours_xldUnion2ClosedContoursXldUnion2ClosedContoursXldUnion2ClosedContoursXld returns 2 (H_MSG_TRUE) if all parameters are correct. If necessary, an exception is raised.

Possible Predecessors

gen_contour_region_xldgen_contour_region_xldGenContourRegionXldGenContourRegionXldGenContourRegionXld, zero_crossing_sub_pixzero_crossing_sub_pixZeroCrossingSubPixZeroCrossingSubPixZeroCrossingSubPix, threshold_sub_pixthreshold_sub_pixThresholdSubPixThresholdSubPixThresholdSubPix

Alternatives

union2union2Union2Union2Union2

See also

difference_closed_contours_xlddifference_closed_contours_xldDifferenceClosedContoursXldDifferenceClosedContoursXldDifferenceClosedContoursXld, symm_difference_closed_contours_xldsymm_difference_closed_contours_xldSymmDifferenceClosedContoursXldSymmDifferenceClosedContoursXldSymmDifferenceClosedContoursXld, intersection_closed_contours_xldintersection_closed_contours_xldIntersectionClosedContoursXldIntersectionClosedContoursXldIntersectionClosedContoursXld, union2_closed_polygons_xldunion2_closed_polygons_xldUnion2ClosedPolygonsXldUnion2ClosedPolygonsXldUnion2ClosedPolygonsXld

Module

Foundation


ClassesClasses | | Operators