symm_difference ( Region1, Region2 : RegionDifference : : )

Calculate the symmetric difference of two regions.

symm_difference calculates the symmetric difference of two regions. Two possible definitions of the symmetric difference can be seen in the example below. A third definition is to regard the exclusive or of the two regions.


Attention

Empty regions are valid for both parameters. On output, empty regions may result. The value of the system flag 'store_empty_region' determines the behavior in this case.


Parameters

Region1 (input_object)
region(-array) -> object
Input region 1.

Region2 (input_object)
region(-array) -> object
Input region 2.

RegionDifference (output_object)
region(-array) -> object
Resulting region.


Example
/* Simulate the symmetric difference of Region1 and Region2 with */
/* difference and union: */
difference(Region1, Region2, Diff1)
difference(Region2, Region1, Diff2)
union(Diff1, Diff2, Difference)

/* Simulate the symmetric difference of Region1 and Region2 with */
/* union, intersection, and difference: */
union(Region1, Region2, Union)
intersection(Region1, Region2, Intersection)
difference(Union, Intersection, Difference)

Result

symm_difference always returns the value 2 (H_MSG_TRUE). The behavior in case of empty input (no regions given) can be set via set_system('no_object_result',<Result>) and the behavior in case of an empty input region via set_system('empty_region_result',<Result>). If necessary, an exception handling is raised.


Parallelization Information

symm_difference is reentrant and processed without parallelization.


Possible Successors

select_shape, disp_region


See also

intersection, union1, union2, complement, difference


Module

Foundation



Copyright © 1996-2008 MVTec Software GmbH