ClassesClasses | | Operators

height_width_ratioheight_width_ratioHeightWidthRatioHeightWidthRatio (Operator)

Name

height_width_ratioheight_width_ratioHeightWidthRatioHeightWidthRatio — 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)

Description

The operator height_width_ratioheight_width_ratioHeightWidthRatioHeightWidthRatioHeightWidthRatio 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 (Row1Row1Row1Row1row1,Column1Column1Column1Column1column1,Row2Row2Row2Row2row2,Column2Column2Column2Column2column2) (see smallest_rectangle1smallest_rectangle1SmallestRectangle1SmallestRectangle1SmallestRectangle1). Based on these values, height_width_ratioheight_width_ratioHeightWidthRatioHeightWidthRatioHeightWidthRatio computes the width, height, and aspect ratio of the smallest surrounding rectangle as follows:

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

Execution Information

Parameters

RegionsRegionsRegionsRegionsregions (input_object)  region(-array) objectHRegionHRegionHobject

Regions to be examined.

HeightHeightHeightHeightheight (output_control)  extent.y(-array) HTupleHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Height of the surrounding rectangle of the region.

WidthWidthWidthWidthwidth (output_control)  extent.x(-array) HTupleHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Width of the surrounding rectangle of the region.

RatioRatioRatioRatioratio (output_control)  real(-array) HTupleHTupleHtuple (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_ratioHeightWidthRatioHeightWidthRatioHeightWidthRatio 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

thresholdthresholdThresholdThresholdThreshold, regiongrowingregiongrowingRegiongrowingRegiongrowingRegiongrowing, connectionconnectionConnectionConnectionConnection, runlength_featuresrunlength_featuresRunlengthFeaturesRunlengthFeaturesRunlengthFeatures

Alternatives

smallest_rectangle1smallest_rectangle1SmallestRectangle1SmallestRectangle1SmallestRectangle1, smallest_rectangle2smallest_rectangle2SmallestRectangle2SmallestRectangle2SmallestRectangle2, region_featuresregion_featuresRegionFeaturesRegionFeaturesRegionFeatures

See also

select_shapeselect_shapeSelectShapeSelectShapeSelectShape, smallest_circlesmallest_circleSmallestCircleSmallestCircleSmallestCircle, elliptic_axiselliptic_axisEllipticAxisEllipticAxisEllipticAxis, area_centerarea_centerAreaCenterAreaCenterAreaCenter

Module

Foundation


ClassesClasses | | Operators