union1union1Union1Union1union1 (算子)
名称
union1union1Union1Union1union1 — 返回所有输入区域的并集。
签名
def union1(region: HObject) -> HObject
描述
union1union1Union1Union1Union1union1 computes the union of all input regions and
returns the result in RegionUnionRegionUnionRegionUnionRegionUnionregionUnionregion_union。
执行信息
- 多线程类型:可重入(与非独占算子并行运行)。
- 多线程作用域:全局(可从任何线程调用)。
- 未采用并行化处理。
参数
RegionRegionRegionRegionregionregion (输入对象) region-array → objectHRegionHObjectHRegionHobject
Regions of which the union is to be computed.
RegionUnionRegionUnionRegionUnionRegionUnionregionUnionregion_union (输出对象) region → objectHRegionHObjectHRegionHobject *
Union of all input regions.
元素数量:
RegionUnion <= Region
示例(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);
示例(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)
示例(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)
示例(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)
复杂度
Let F be the sum of all areas of the input regions. Then the
runtime complexity is O(log(sqrt(F)) * sqrt(F)).
结果
union1union1Union1Union1Union1union1 始终返回 2 ( H_MSG_TRUE )。当输入为空(未指定区域)时则可设置行为通过 set_system('no_object_result',<Result>)set_system("no_object_result",<Result>)SetSystem("no_object_result",<Result>)SetSystem("no_object_result",<Result>)SetSystem("no_object_result",<Result>)set_system("no_object_result",<Result>) 以及输入区域为空时可设置行为通过 set_system('empty_region_result',<Result>)set_system("empty_region_result",<Result>)SetSystem("empty_region_result",<Result>)SetSystem("empty_region_result",<Result>)SetSystem("empty_region_result",<Result>)set_system("empty_region_result",<Result>)。如有必要,则抛出异常。
可能的前趋
thresholdthresholdThresholdThresholdThresholdthreshold,
connectionconnectionConnectionConnectionConnectionconnection,
regiongrowingregiongrowingRegiongrowingRegiongrowingRegiongrowingregiongrowing,
pouringpouringPouringPouringPouringpouring
可能的后继
select_shapeselect_shapeSelectShapeSelectShapeSelectShapeselect_shape,
disp_regiondisp_regionDispRegionDispRegionDispRegiondisp_region
替代
union2union2Union2Union2Union2union2
另见
intersectionintersectionIntersectionIntersectionIntersectionintersection,
complementcomplementComplementComplementComplementcomplement
模块
基础