Skip to content

union1Union1Union1union1union1🔗

Short description🔗

union1Union1Union1union1union1 — Return the union of all input regions.

Signature🔗

union1( region Region, out region RegionUnion )void Union1( const HObject& Region, HObject* RegionUnion )static void HOperatorSet.Union1( HObject region, out HObject regionUnion )def union1( region: HObject ) -> HObject

Herror union1( const Hobject Region, Hobject* RegionUnion )

Herror T_union1( const Hobject Region, Hobject* RegionUnion )

HRegion HRegion::Union1( ) const

HRegion HRegion.Union1( )

Description🔗

union1Union1 computes the union of all input regions and returns the result in RegionUnionregionUnionregion_union.

Execution information🔗

Execution information
  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).

  • Multithreading scope: global (may be called from any thread).

  • Processed without parallelization.

Parameters🔗

Regionregionregion (input_object) region-array → objectHObjectHRegionHObjectHobject

Regions of which the union is to be computed.

RegionUnionregionUnionregion_union (output_object) region → objectHObjectHRegionHObjectHobject *

Union of all input regions.

Number of elements: RegionUnion <= Region

Example🔗

(HDevelop)

* Union of segmentation results:
threshold(Image,Region1,128,255)
dyn_threshold(Image,Mean,Region2,5,'light')
concat_obj(Region1,Region2,Regions)
union1(Regions,RegionUnion)
(C)
/* Union of segmentation results: */
threshold(Image,&Region1,128.0,255.0)\;
dyn_threshold(Image,Mean,&Region2,5.0,"light")\;
concat_obj(Region1,Region2,&Regions)\;
union1(Regions,&RegionUnion)\;

Complexity🔗

Let \(F\) be the sum of all areas of the input regions. Then the runtime complexity is \(O(\log(\sqrt{F}) * \sqrt{F})\).

Result🔗

union1Union1 always returns 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 is raised.

Combinations with other operators🔗

Combinations

Possible predecessors

thresholdThreshold, connectionConnection, regiongrowingRegiongrowing, pouringPouring

Possible successors

select_shapeSelectShape, disp_regionDispRegion

Alternatives

union2Union2

See also

intersectionIntersection, complementComplement

Module🔗

Foundation