smallest_circle smallest_circle SmallestCircle SmallestCircle smallest_circle (算子)
名称
smallest_circle smallest_circle SmallestCircle SmallestCircle smallest_circle — 区域的最小外接圆。
签名
def smallest_circle (regions : HObject) -> Tuple[Sequence[float], Sequence[float], Sequence[float]]
def smallest_circle_s (regions : HObject) -> Tuple[float, float, float]
描述
算子 smallest_circle smallest_circle SmallestCircle SmallestCircle SmallestCircle smallest_circle determines the smallest
surrounding circle of a region, i.e., the circle with the smallest
area of all circles containing the region. For this circle the
center (Row Row Row Row row row ,Column Column Column Column column column ) and the radius
(Radius Radius Radius Radius radius radius ) are calculated. The operator is applied when,
for example, the location and size of circular objects (e.g.,
coins) which, however, are not homogeneous inside or have broken
edges due to bad segmentation, has to be determined. The output of
the operator is selected in such a way that it can be used as input
for the operators disp_circle disp_circle DispCircle DispCircle DispCircle disp_circle and
gen_circle gen_circle GenCircle GenCircle GenCircle gen_circle 。
In the documentation of this chapter (Regions / Features ), you can
find an image illustrating regions with varying outer and inner radii.
If several regions are passed in Regions Regions Regions Regions regions regions corresponding
tuples are returned as output parameter. In case of empty region
all parameters have the value 0.0 if no other behavior was set (see
set_system set_system SetSystem SetSystem SetSystem set_system ).
注意
Internally, the calculation is based on the center coordinates of
the region pixels. To take into account that pixels are not just
infinitely small points but have a certain area, the calculated
radius is enlarged by 0.5 before it is returned in
Radius Radius Radius Radius radius radius . This, in most cases, gives acceptable results.
However, in the worst case (pixel diagonal) this enlargement is not
sufficient. If one wants to ensure that the border of the input
region completely lies within the circle, one had to enlarge the
radius by
instead of 0.5. Consequently,
the value returned in Radius Radius Radius Radius radius radius must be corrected by
. However, this would also be only
an upper bound, i.e., the circle with the corrected radius would be
slightly too big in most cases.
执行信息
多线程类型:可重入(与非独占算子并行运行)。
多线程作用域:全局(可从任何线程调用)。
在元组级别上自动并行化。
参数
Regions Regions Regions Regions regions regions (输入对象) region(-array) → object HRegion HObject HRegion Hobject
Regions to be examined.
Row Row Row Row row row (输出控制) circle.center.y(-array) → HTuple Sequence[float] HTuple Htuple (real) (double ) (double ) (double )
中心行索引。
Column Column Column Column column column (输出控制) circle.center.x(-array) → HTuple Sequence[float] HTuple Htuple (real) (double ) (double ) (double )
中心列索引。
Radius Radius Radius Radius radius radius (输出控制) circle.radius(-array) → HTuple Sequence[float] HTuple Htuple (real) (double ) (double ) (double )
Radius of the surrounding circle.
断言:
Radius >= 0
示例(HDevelop)
read_image(Image,'fabrik')
regiongrowing(Image,Regions,5,5,6,100)
select_shape(Regions,SelectedRegions,'area','and',100,2000)
smallest_circle(SelectedRegions,Row,Column,Radius)
gen_circle(Circles,Row,Column,Radius)
dev_display (Circles)
示例(C)
read_image(&Image,"fabrik");
regiongrowing(Image,&Regions,5,5,6.0,100);
select_shape(Regions,&SelectedRegions,"area","and",100.0,2000.0);
T_smallest_circle(SelectedRegions,&Row,&Column,&Radius);
T_gen_circle(&Circles,Row,Column,Radius);
示例(HDevelop)
read_image(Image,'fabrik')
regiongrowing(Image,Regions,5,5,6,100)
select_shape(Regions,SelectedRegions,'area','and',100,2000)
smallest_circle(SelectedRegions,Row,Column,Radius)
gen_circle(Circles,Row,Column,Radius)
dev_display (Circles)
示例(HDevelop)
read_image(Image,'fabrik')
regiongrowing(Image,Regions,5,5,6,100)
select_shape(Regions,SelectedRegions,'area','and',100,2000)
smallest_circle(SelectedRegions,Row,Column,Radius)
gen_circle(Circles,Row,Column,Radius)
dev_display (Circles)
示例(HDevelop)
read_image(Image,'fabrik')
regiongrowing(Image,Regions,5,5,6,100)
select_shape(Regions,SelectedRegions,'area','and',100,2000)
smallest_circle(SelectedRegions,Row,Column,Radius)
gen_circle(Circles,Row,Column,Radius)
dev_display (Circles)
复杂度
If F is the area of the region, then the mean runtime complexity
is O(sqrt(F).
结果
算子 smallest_circle smallest_circle SmallestCircle SmallestCircle SmallestCircle smallest_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>) 。当空区域(区域是空集)时,可设置行为通过算子 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>) 。如有必要,则抛出异常。
可能的前趋
threshold threshold Threshold Threshold Threshold threshold ,
regiongrowing regiongrowing Regiongrowing Regiongrowing Regiongrowing regiongrowing ,
connection connection Connection Connection Connection connection ,
runlength_features runlength_features RunlengthFeatures RunlengthFeatures RunlengthFeatures runlength_features
可能的后继
gen_circle gen_circle GenCircle GenCircle GenCircle gen_circle ,
disp_circle disp_circle DispCircle DispCircle DispCircle disp_circle
替代
elliptic_axis elliptic_axis EllipticAxis EllipticAxis EllipticAxis elliptic_axis ,
smallest_rectangle1 smallest_rectangle1 SmallestRectangle1 SmallestRectangle1 SmallestRectangle1 smallest_rectangle1 ,
smallest_rectangle2 smallest_rectangle2 SmallestRectangle2 SmallestRectangle2 SmallestRectangle2 smallest_rectangle2
另见
set_shape set_shape SetShape SetShape SetShape set_shape ,
select_shape select_shape SelectShape SelectShape SelectShape select_shape ,
inner_circle inner_circle InnerCircle InnerCircle InnerCircle inner_circle
模块
基础