height_width_ratio height_width_ratio HeightWidthRatio HeightWidthRatio height_width_ratio (Operator)
Name
height_width_ratio height_width_ratio HeightWidthRatio HeightWidthRatio height_width_ratio
— Compute the width, height, and aspect ratio of the surrounding
rectangle parallel to the coordinate axes.
Signature
def height_width_ratio (regions : HObject) -> Tuple[Sequence[int], Sequence[int], Sequence[float]]
def height_width_ratio_s (regions : HObject) -> Tuple[int, int, float]
Description
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
).
Execution Information
Multithreading type: reentrant (runs in parallel with non-exclusive operators).
Multithreading scope: global (may be called from any thread).
Automatically parallelized on tuple level.
Parameters
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.
Complexity
If F is the area of the region the mean runtime complexity is
O(sqrt(F)).
Result
The operator height_width_ratio height_width_ratio HeightWidthRatio HeightWidthRatio HeightWidthRatio height_width_ratio
returns the value 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.
Possible Predecessors
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
Alternatives
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
See also
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
Module
Foundation