height_width_ratioheight_width_ratioHeightWidthRatioHeightWidthRatioheight_width_ratio (Operator)

Name

height_width_ratioheight_width_ratioHeightWidthRatioHeightWidthRatioheight_width_ratio — Compute the width, height, and aspect ratio of the surrounding rectangle parallel to the coordinate axes.

Signature

height_width_ratio(Regions : : : Height, Width, Ratio)

Herror height_width_ratio(const Hobject Regions, Hlong* Height, Hlong* Width, double* Ratio)

Herror T_height_width_ratio(const Hobject Regions, Htuple* Height, Htuple* Width, Htuple* Ratio)

void HeightWidthRatio(const HObject& Regions, HTuple* Height, HTuple* Width, HTuple* Ratio)

HTuple HRegion::HeightWidthRatio(HTuple* Width, HTuple* Ratio) const

Hlong HRegion::HeightWidthRatio(Hlong* Width, double* Ratio) const

static void HOperatorSet.HeightWidthRatio(HObject regions, out HTuple height, out HTuple width, out HTuple ratio)

HTuple HRegion.HeightWidthRatio(out HTuple width, out HTuple ratio)

int HRegion.HeightWidthRatio(out int width, out double 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]

Description

The operator height_width_ratioheight_width_ratioHeightWidthRatioHeightWidthRatioHeightWidthRatioheight_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 (Row1Row1Row1Row1row1row_1,Column1Column1Column1Column1column1column_1,Row2Row2Row2Row2row2row_2,Column2Column2Column2Column2column2column_2) (see smallest_rectangle1smallest_rectangle1SmallestRectangle1SmallestRectangle1SmallestRectangle1smallest_rectangle1). Based on these values, height_width_ratioheight_width_ratioHeightWidthRatioHeightWidthRatioHeightWidthRatioheight_width_ratio computes the width, height, and aspect ratio of the smallest surrounding rectangle as follows:

If more than one region is passed in RegionsRegionsRegionsRegionsregionsregions, the results are stored in tuples in the same order as the respective regions in the RegionsRegionsRegionsRegionsregionsregions. In case of empty regions, all parameters have the value 0 if no other behavior was set (see set_systemset_systemSetSystemSetSystemSetSystemset_system).

Execution Information

Parameters

RegionsRegionsRegionsRegionsregionsregions (input_object)  region(-array) objectHRegionHObjectHRegionHobject

Regions to be examined.

HeightHeightHeightHeightheightheight (output_control)  extent.y(-array) HTupleSequence[int]HTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Height of the surrounding rectangle of the region.

WidthWidthWidthWidthwidthwidth (output_control)  extent.x(-array) HTupleSequence[int]HTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Width of the surrounding rectangle of the region.

RatioRatioRatioRatioratioratio (output_control)  real(-array) HTupleSequence[float]HTupleHtuple (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_ratioheight_width_ratioHeightWidthRatioHeightWidthRatioHeightWidthRatioheight_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.

Possible Predecessors

thresholdthresholdThresholdThresholdThresholdthreshold, regiongrowingregiongrowingRegiongrowingRegiongrowingRegiongrowingregiongrowing, connectionconnectionConnectionConnectionConnectionconnection, runlength_featuresrunlength_featuresRunlengthFeaturesRunlengthFeaturesRunlengthFeaturesrunlength_features

Alternatives

smallest_rectangle1smallest_rectangle1SmallestRectangle1SmallestRectangle1SmallestRectangle1smallest_rectangle1, smallest_rectangle2smallest_rectangle2SmallestRectangle2SmallestRectangle2SmallestRectangle2smallest_rectangle2, region_featuresregion_featuresRegionFeaturesRegionFeaturesRegionFeaturesregion_features

See also

select_shapeselect_shapeSelectShapeSelectShapeSelectShapeselect_shape, smallest_circlesmallest_circleSmallestCircleSmallestCircleSmallestCirclesmallest_circle, elliptic_axiselliptic_axisEllipticAxisEllipticAxisEllipticAxiselliptic_axis, area_centerarea_centerAreaCenterAreaCenterAreaCenterarea_center

Module

Foundation