height_width_ratioheight_width_ratioHeightWidthRatioHeightWidthRatioheight_width_ratio (算子名称)

名称

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

参数签名

height_width_ratio(区域 : : : Height, Width, Ratio)

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

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

void HeightWidthRatio(const HObject& 区域, 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 区域, 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(区域: HObject) -> Tuple[Sequence[int], Sequence[int], Sequence[float]]

def height_width_ratio_s(区域: HObject) -> Tuple[int, int, float]

描述

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 区域区域区域区域区域区域, the results are stored in tuples in the same order as the respective regions in the 区域区域区域区域区域区域. In case of empty regions, all parameters have the value 0 if no other behavior was set (see set_systemset_systemSetSystemSetSystemSetSystemset_system).

运行信息

参数表

区域区域区域区域区域区域 (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)).

结果

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.

可能的前置算子

thresholdthresholdThresholdThresholdThresholdthreshold, regiongrowingregiongrowingRegiongrowingRegiongrowingRegiongrowingregiongrowing, connectionconnectionConnectionConnectionConnectionconnection, runlength_featuresrunlength_featuresRunlengthFeaturesRunlengthFeaturesRunlengthFeaturesrunlength_features

可替代算子

smallest_rectangle1smallest_rectangle1SmallestRectangle1SmallestRectangle1SmallestRectangle1smallest_rectangle1, smallest_rectangle2smallest_rectangle2SmallestRectangle2SmallestRectangle2SmallestRectangle2smallest_rectangle2, region_featuresregion_featuresRegionFeaturesRegionFeaturesRegionFeaturesregion_features

参考其它

select_shapeselect_shapeSelectShapeSelectShapeSelectShapeselect_shape, smallest_circlesmallest_circleSmallestCircleSmallestCircleSmallestCirclesmallest_circle, elliptic_axiselliptic_axisEllipticAxisEllipticAxisEllipticAxiselliptic_axis, area_centerarea_centerAreaCenterAreaCenterAreaCenterarea_center

模块

Foundation