height_width_ratio height_width_ratio HeightWidthRatio HeightWidthRatio height_width_ratio (算子)
名称
height_width_ratio height_width_ratio HeightWidthRatio HeightWidthRatio height_width_ratio — 计算平行于坐标轴的周围矩形的宽度、高度和纵横比。
签名
def height_width_ratio (regions : HObject) -> Tuple[Sequence[int], Sequence[int], Sequence[float]]
def height_width_ratio_s (regions : HObject) -> Tuple[int, int, float]
描述
The operator height_width_ratio height_width_ratio HeightWidthRatio HeightWidthRatio HeightWidthRatio height_width_ratio calculates the surrounding
rectangle of all input regions (parallel to the coordinate axes).
The surrounding rectangle is described by the coordinates of the
corner pixels
(Row1 Row1 Row1 Row1 row1 row_1 ,Column1 Column1 Column1 Column1 column1 column_1 ,Row2 Row2 Row2 Row2 row2 row_2 ,Column2 Column2 Column2 Column2 column2 column_2 )
(see smallest_rectangle1 smallest_rectangle1 SmallestRectangle1 SmallestRectangle1 SmallestRectangle1 smallest_rectangle1 ). Based on these values,
height_width_ratio height_width_ratio HeightWidthRatio HeightWidthRatio HeightWidthRatio height_width_ratio computes the width, height, and aspect
ratio of the smallest surrounding rectangle as follows:
If more than one region is passed in Regions Regions Regions Regions regions regions , the results
are stored in tuples in the same order as the respective regions in
the Regions Regions Regions Regions regions regions . In case of empty regions, all parameters have
the value 0 if no other behavior was set (see set_system set_system SetSystem SetSystem SetSystem set_system ).
执行信息
多线程类型:可重入(与非独占算子并行运行)。
多线程作用域:全局(可从任何线程调用)。
在元组级别上自动并行化。
参数
Regions Regions Regions Regions regions regions (input_object) region(-array) → object HRegion HObject HRegion Hobject
Regions to be examined.
Height Height Height Height height height (output_control) extent.y(-array) → HTuple Sequence[int] HTuple Htuple (integer) (int / long) (Hlong ) (Hlong )
Height of the surrounding rectangle of the region.
Width Width Width Width width width (output_control) extent.x(-array) → HTuple Sequence[int] HTuple Htuple (integer) (int / long) (Hlong ) (Hlong )
Width of the surrounding rectangle of the region.
Ratio Ratio Ratio Ratio ratio ratio (output_control) real(-array) → HTuple Sequence[float] HTuple Htuple (real) (double ) (double ) (double )
Aspect ratio of the surrounding rectangle of the region.
复杂性
若 F 为区域面积,则平均运行时间复杂生为 O(√F)。
结果
The operator height_width_ratio height_width_ratio HeightWidthRatio HeightWidthRatio HeightWidthRatio height_width_ratio returns the value 2 (
H_MSG_TRUE )
if
the input is not empty. The behavior in case of empty input (no
input regions available) is set via the operator
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 (the region is the empty set) 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>) . If necessary an
exception is raised.
可能的前趋
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
替代
smallest_rectangle1 smallest_rectangle1 SmallestRectangle1 SmallestRectangle1 SmallestRectangle1 smallest_rectangle1 ,
smallest_rectangle2 smallest_rectangle2 SmallestRectangle2 SmallestRectangle2 SmallestRectangle2 smallest_rectangle2 ,
region_features region_features RegionFeatures RegionFeatures RegionFeatures region_features
另见
select_shape select_shape SelectShape SelectShape SelectShape select_shape ,
smallest_circle smallest_circle SmallestCircle SmallestCircle SmallestCircle smallest_circle ,
elliptic_axis elliptic_axis EllipticAxis EllipticAxis EllipticAxis elliptic_axis ,
area_center area_center AreaCenter AreaCenter AreaCenter area_center
模块
Foundation