symm_difference_closed_contours_xldsymm_difference_closed_contours_xldSymmDifferenceClosedContoursXldSymmDifferenceClosedContoursXldsymm_difference_closed_contours_xld (Operator)

Name

symm_difference_closed_contours_xldsymm_difference_closed_contours_xldSymmDifferenceClosedContoursXldSymmDifferenceClosedContoursXldsymm_difference_closed_contours_xld — Compute the symmetric difference of closed contours.

Signature

symm_difference_closed_contours_xld(Contours1, Contours2 : ContoursDifference : : )

Herror symm_difference_closed_contours_xld(const Hobject Contours1, const Hobject Contours2, Hobject* ContoursDifference)

Herror T_symm_difference_closed_contours_xld(const Hobject Contours1, const Hobject Contours2, Hobject* ContoursDifference)

void SymmDifferenceClosedContoursXld(const HObject& Contours1, const HObject& Contours2, HObject* ContoursDifference)

HXLDCont HXLDCont::SymmDifferenceClosedContoursXld(const HXLDCont& Contours2) const

static void HOperatorSet.SymmDifferenceClosedContoursXld(HObject contours1, HObject contours2, out HObject contoursDifference)

HXLDCont HXLDCont.SymmDifferenceClosedContoursXld(HXLDCont contours2)

def symm_difference_closed_contours_xld(contours_1: HObject, contours_2: HObject) -> HObject

Description

The operator symm_difference_closed_contours_xldsymm_difference_closed_contours_xldSymmDifferenceClosedContoursXldSymmDifferenceClosedContoursXldSymmDifferenceClosedContoursXldsymm_difference_closed_contours_xld calculates the symmetric difference of the regions enclosed by the contours Contours1Contours1Contours1Contours1contours1contours_1 and Contours2Contours2Contours2Contours2contours2contours_2. The boundaries of this symmetric difference are returned in ContoursDifferenceContoursDifferenceContoursDifferenceContoursDifferencecontoursDifferencecontours_difference.

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 (Contours1Contours1Contours1Contours1contours1contours_1 and Contours2Contours2Contours2Contours2contours2contours_2, respectively) are determined as described below. Then, the symmetric difference 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 Contours1Contours1Contours1Contours1contours1contours_1 and Contours2Contours2Contours2Contours2contours2contours_2, 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 ContoursDifferenceContoursDifferenceContoursDifferenceContoursDifferencecontoursDifferencecontours_difference 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""is_hole". For further information about global contour attributes see get_contour_global_attrib_xldget_contour_global_attrib_xldGetContourGlobalAttribXldGetContourGlobalAttribXldGetContourGlobalAttribXldget_contour_global_attrib_xld.

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

Execution Information

Parameters

Contours1Contours1Contours1Contours1contours1contours_1 (input_object)  xld_cont(-array) objectHXLDContHObjectHXLDContHobject

Contours enclosing the first region.

Contours2Contours2Contours2Contours2contours2contours_2 (input_object)  xld_cont(-array) objectHXLDContHObjectHXLDContHobject

Contours enclosing the second region.

ContoursDifferenceContoursDifferenceContoursDifferenceContoursDifferencecontoursDifferencecontours_difference (output_object)  xld_cont(-array) objectHXLDContHObjectHXLDContHobject *

Contours enclosing the symmetric difference.

Result

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

Possible Predecessors

gen_contour_region_xldgen_contour_region_xldGenContourRegionXldGenContourRegionXldGenContourRegionXldgen_contour_region_xld, zero_crossing_sub_pixzero_crossing_sub_pixZeroCrossingSubPixZeroCrossingSubPixZeroCrossingSubPixzero_crossing_sub_pix, threshold_sub_pixthreshold_sub_pixThresholdSubPixThresholdSubPixThresholdSubPixthreshold_sub_pix

Alternatives

symm_differencesymm_differenceSymmDifferenceSymmDifferenceSymmDifferencesymm_difference

See also

intersection_closed_contours_xldintersection_closed_contours_xldIntersectionClosedContoursXldIntersectionClosedContoursXldIntersectionClosedContoursXldintersection_closed_contours_xld, difference_closed_contours_xlddifference_closed_contours_xldDifferenceClosedContoursXldDifferenceClosedContoursXldDifferenceClosedContoursXlddifference_closed_contours_xld, union2_closed_contours_xldunion2_closed_contours_xldUnion2ClosedContoursXldUnion2ClosedContoursXldUnion2ClosedContoursXldunion2_closed_contours_xld, symm_difference_closed_polygons_xldsymm_difference_closed_polygons_xldSymmDifferenceClosedPolygonsXldSymmDifferenceClosedPolygonsXldSymmDifferenceClosedPolygonsXldsymm_difference_closed_polygons_xld

Module

Foundation