height_width_ratio height_width_ratio HeightWidthRatio HeightWidthRatio (Operator)
Name
height_width_ratio height_width_ratio HeightWidthRatio HeightWidthRatio
— Compute the width, height, and aspect ratio of the surrounding
rectangle parallel to the coordinate axes.
Signature
Description
The operator height_width_ratio height_width_ratio HeightWidthRatio HeightWidthRatio HeightWidthRatio
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
,Column1 Column1 Column1 Column1 column1
,Row2 Row2 Row2 Row2 row2
,Column2 Column2 Column2 Column2 column2
)
(see smallest_rectangle1 smallest_rectangle1 SmallestRectangle1 SmallestRectangle1 SmallestRectangle1
). Based on these values,
height_width_ratio height_width_ratio HeightWidthRatio HeightWidthRatio HeightWidthRatio
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
, the results
are stored in tuples in the same order as the respective regions in
the 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
).
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
(input_object) region(-array) →
object HRegion HRegion Hobject
Regions to be examined.
Height Height Height Height height
(output_control) extent.y(-array) →
HTuple HTuple Htuple (integer) (int / long) (Hlong ) (Hlong )
Height of the surrounding rectangle of the region.
Width Width Width Width width
(output_control) extent.x(-array) →
HTuple HTuple Htuple (integer) (int / long) (Hlong ) (Hlong )
Width of the surrounding rectangle of the region.
Ratio Ratio Ratio Ratio ratio
(output_control) real(-array) →
HTuple 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
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>)
. 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>)
. If necessary an
exception is raised.
Possible Predecessors
threshold threshold Threshold Threshold Threshold
,
regiongrowing regiongrowing Regiongrowing Regiongrowing Regiongrowing
,
connection connection Connection Connection Connection
,
runlength_features runlength_features RunlengthFeatures RunlengthFeatures RunlengthFeatures
Alternatives
smallest_rectangle1 smallest_rectangle1 SmallestRectangle1 SmallestRectangle1 SmallestRectangle1
,
smallest_rectangle2 smallest_rectangle2 SmallestRectangle2 SmallestRectangle2 SmallestRectangle2
,
region_features region_features RegionFeatures RegionFeatures RegionFeatures
See also
select_shape select_shape SelectShape SelectShape SelectShape
,
smallest_circle smallest_circle SmallestCircle SmallestCircle SmallestCircle
,
elliptic_axis elliptic_axis EllipticAxis EllipticAxis EllipticAxis
,
area_center area_center AreaCenter AreaCenter AreaCenter
Module
Foundation