inner_circleinner_circleInnerCircleInnerCircleinner_circle(算子)
名称
inner_circleinner_circleInnerCircleInnerCircleinner_circle — 区域的最大内部圆。
签名
def inner_circle(regions: HObject) -> Tuple[Sequence[float], Sequence[float], Sequence[float]]
def inner_circle_s(regions: HObject) -> Tuple[float, float, float]
描述
算子 inner_circleinner_circleInnerCircleInnerCircleInnerCircleinner_circle determines the largest inner circle
of a region.
This is the biggest discrete circle region that completely fits into
the region.
For this circle the center (RowRowRowRowrowrow, ColumnColumnColumnColumncolumncolumn) and the
radius (RadiusRadiusRadiusRadiusradiusradius) are calculated.
If the position of the circle is ambiguous, the "first possible"
position (as far upper left as possible) is returned.
In the documentation of this chapter (Regions / Features), you can
find an image illustrating regions with varying inner circles.
The output of the operator is chosen in such a way that it can be
used as an input for the operators disp_circledisp_circleDispCircleDispCircleDispCircledisp_circle,
gen_circlegen_circleGenCircleGenCircleGenCirclegen_circle, and gen_ellipse_contour_xldgen_ellipse_contour_xldGenEllipseContourXldGenEllipseContourXldGenEllipseContourXldgen_ellipse_contour_xld。
If several regions are passed in RegionsRegionsRegionsRegionsregionsregions corresponding tuples
are returned as output parameters.
In case of an empty input region all parameters have the value
0.0 if no other behavior was set with set_systemset_systemSetSystemSetSystemSetSystemset_system。
注意
If several inner circles are present at a region
only the most upper left solution is returned.
执行信息
- 多线程类型:可重入(与非独占算子并行运行)。
- 多线程作用域:全局(可从任何线程调用)。
- 在元组级别上自动并行化。
参数
RegionsRegionsRegionsRegionsregionsregions (输入对象) region(-array) → objectHRegionHObjectHRegionHobject
Regions to be examined.
RowRowRowRowrowrow (输出控制) circle.center.y(-array) → HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)
中心行索引。
ColumnColumnColumnColumncolumncolumn (输出控制) circle.center.x(-array) → HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)
中心列索引。
RadiusRadiusRadiusRadiusradiusradius (输出控制) circle.radius(-array) → HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)
Radius of the inner circle.
Assertion:
Radius >= 0
示例(HDevelop)
read_image(Image,'fabrik')
regiongrowing(Image,Seg,5,5,6,100)
select_shape(Seg,H,'area','and',100,2000)
inner_circle(H,Row,Column,Radius)
gen_circle(Circles,Row,Column,Radius)
dev_set_draw('margin')
dev_display(Circles)
示例(C)
read_image(&Image,"fabrik");
regiongrowing(Image,&Seg,5,5,6.0,100);
select_shape(Seg,&H,"area","and",100.0,2000.0);
T_inner_circle(H,&Row,&Column,&Radius);
T_gen_circle(&Circles,Row,Column,Radius);
示例(HDevelop)
read_image(Image,'fabrik')
regiongrowing(Image,Seg,5,5,6,100)
select_shape(Seg,H,'area','and',100,2000)
inner_circle(H,Row,Column,Radius)
gen_circle(Circles,Row,Column,Radius)
dev_set_draw('margin')
dev_display(Circles)
示例(HDevelop)
read_image(Image,'fabrik')
regiongrowing(Image,Seg,5,5,6,100)
select_shape(Seg,H,'area','and',100,2000)
inner_circle(H,Row,Column,Radius)
gen_circle(Circles,Row,Column,Radius)
dev_set_draw('margin')
dev_display(Circles)
示例(HDevelop)
read_image(Image,'fabrik')
regiongrowing(Image,Seg,5,5,6,100)
select_shape(Seg,H,'area','and',100,2000)
inner_circle(H,Row,Column,Radius)
gen_circle(Circles,Row,Column,Radius)
dev_set_draw('margin')
dev_display(Circles)
复杂度
If F is the area of the region and R is the radius of the
inner circle the runtime complexity is O(sqrt(F) * R).
结果
算子 inner_circleinner_circleInnerCircleInnerCircleInnerCircleinner_circle 在输入不为空时返回值 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>),
the behavior in case of empty region is set via
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,
regiongrowingregiongrowingRegiongrowingRegiongrowingRegiongrowingregiongrowing,
connectionconnectionConnectionConnectionConnectionconnection,
runlength_featuresrunlength_featuresRunlengthFeaturesRunlengthFeaturesRunlengthFeaturesrunlength_features
可能的后继
gen_circlegen_circleGenCircleGenCircleGenCirclegen_circle,
disp_circledisp_circleDispCircleDispCircleDispCircledisp_circle
替代
erosion_circleerosion_circleErosionCircleErosionCircleErosionCircleerosion_circle,
inner_rectangle1inner_rectangle1InnerRectangle1InnerRectangle1InnerRectangle1inner_rectangle1
另见
set_shapeset_shapeSetShapeSetShapeSetShapeset_shape,
select_shapeselect_shapeSelectShapeSelectShapeSelectShapeselect_shape,
smallest_circlesmallest_circleSmallestCircleSmallestCircleSmallestCirclesmallest_circle
模块
基础