smallest_rectangle1smallest_rectangle1SmallestRectangle1SmallestRectangle1smallest_rectangle1(算子)

名称

smallest_rectangle1smallest_rectangle1SmallestRectangle1SmallestRectangle1smallest_rectangle1 — 与坐标轴平行的包围矩形。

签名

smallest_rectangle1(Regions : : : Row1, Column1, Row2, Column2)

Herror smallest_rectangle1(const Hobject Regions, Hlong* Row1, Hlong* Column1, Hlong* Row2, Hlong* Column2)

Herror T_smallest_rectangle1(const Hobject Regions, Htuple* Row1, Htuple* Column1, Htuple* Row2, Htuple* Column2)

void SmallestRectangle1(const HObject& Regions, HTuple* Row1, HTuple* Column1, HTuple* Row2, HTuple* Column2)

void HRegion::SmallestRectangle1(HTuple* Row1, HTuple* Column1, HTuple* Row2, HTuple* Column2) const

void HRegion::SmallestRectangle1(Hlong* Row1, Hlong* Column1, Hlong* Row2, Hlong* Column2) const

static void HOperatorSet.SmallestRectangle1(HObject regions, out HTuple row1, out HTuple column1, out HTuple row2, out HTuple column2)

void HRegion.SmallestRectangle1(out HTuple row1, out HTuple column1, out HTuple row2, out HTuple column2)

void HRegion.SmallestRectangle1(out int row1, out int column1, out int row2, out int column2)

def smallest_rectangle1(regions: HObject) -> Tuple[Sequence[int], Sequence[int], Sequence[int], Sequence[int]]

def smallest_rectangle1_s(regions: HObject) -> Tuple[int, int, int, int]

描述

算子 smallest_rectangle1smallest_rectangle1SmallestRectangle1SmallestRectangle1SmallestRectangle1smallest_rectangle1 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). The calculation of the rectangle is based on the center coordinates of the region pixels.

The smallest axis aligned surrounding rectangle of a region. Note that the calculation is based on the center coordinates of the region pixels.

If more than one region is passed in RegionsRegionsRegionsRegionsregionsregions, the results are stored in tuples, the index of a value in the tuple corresponding to the index of a region in the input. In case of empty region all parameters have the value 0 if no other behavior was set (see set_systemset_systemSetSystemSetSystemSetSystemset_system).

注意

In case of empty region the result of Row1Row1Row1Row1row1row_1,Column1Column1Column1Column1column1column_1, Row2Row2Row2Row2row2row_2 and Column2Column2Column2Column2column2column_2 (all are 0) can lead to confusion.

执行信息

参数

RegionsRegionsRegionsRegionsregionsregions (输入对象)  region(-array) objectHRegionHObjectHRegionHobject

Regions to be examined.

Row1Row1Row1Row1row1row_1 (输出控制)  rectangle.origin.y(-array) HTupleSequence[int]HTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Line index of upper left corner point.

Column1Column1Column1Column1column1column_1 (输出控制)  rectangle.origin.x(-array) HTupleSequence[int]HTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Column index of upper left corner point.

Row2Row2Row2Row2row2row_2 (输出控制)  rectangle.corner.y(-array) HTupleSequence[int]HTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Line index of lower right corner point.

Column2Column2Column2Column2column2column_2 (输出控制)  rectangle.corner.x(-array) HTupleSequence[int]HTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Column index of lower right corner point.

复杂度

若 F 为区域面积,则平均运行时间复杂生为 O(√F)。

结果

算子 smallest_rectangle1smallest_rectangle1SmallestRectangle1SmallestRectangle1SmallestRectangle1smallest_rectangle1 在输入不为空时返回值 2 ( H_MSG_TRUE )。当输入为空(无可用输入区域)时,可设置行为通过算子 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>)。空区域(区域是空集)的情况下的可设置行为通过 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>)。如有必要,则抛出异常。

可能的前趋

thresholdthresholdThresholdThresholdThresholdthreshold, regiongrowingregiongrowingRegiongrowingRegiongrowingRegiongrowingregiongrowing, connectionconnectionConnectionConnectionConnectionconnection, runlength_featuresrunlength_featuresRunlengthFeaturesRunlengthFeaturesRunlengthFeaturesrunlength_features

可能的后继

disp_rectangle1disp_rectangle1DispRectangle1DispRectangle1DispRectangle1disp_rectangle1, gen_rectangle1gen_rectangle1GenRectangle1GenRectangle1GenRectangle1gen_rectangle1

替代

height_width_ratioheight_width_ratioHeightWidthRatioHeightWidthRatioHeightWidthRatioheight_width_ratio, smallest_rectangle2smallest_rectangle2SmallestRectangle2SmallestRectangle2SmallestRectangle2smallest_rectangle2, area_centerarea_centerAreaCenterAreaCenterAreaCenterarea_center

另见

select_shapeselect_shapeSelectShapeSelectShapeSelectShapeselect_shape

模块

基础