smallest_rectangle1_xldsmallest_rectangle1_xldSmallestRectangle1XldSmallestRectangle1Xldsmallest_rectangle1_xld (算子)

名称

smallest_rectangle1_xldsmallest_rectangle1_xldSmallestRectangle1XldSmallestRectangle1Xldsmallest_rectangle1_xld — 包围平行于轮廓或多边形坐标轴的矩形。

签名

smallest_rectangle1_xld(XLD : : : Row1, Column1, Row2, Column2)

Herror smallest_rectangle1_xld(const Hobject XLD, double* Row1, double* Column1, double* Row2, double* Column2)

Herror T_smallest_rectangle1_xld(const Hobject XLD, Htuple* Row1, Htuple* Column1, Htuple* Row2, Htuple* Column2)

void SmallestRectangle1Xld(const HObject& XLD, HTuple* Row1, HTuple* Column1, HTuple* Row2, HTuple* Column2)

void HXLD::SmallestRectangle1Xld(HTuple* Row1, HTuple* Column1, HTuple* Row2, HTuple* Column2) const

void HXLD::SmallestRectangle1Xld(double* Row1, double* Column1, double* Row2, double* Column2) const

static void HOperatorSet.SmallestRectangle1Xld(HObject XLD, out HTuple row1, out HTuple column1, out HTuple row2, out HTuple column2)

void HXLD.SmallestRectangle1Xld(out HTuple row1, out HTuple column1, out HTuple row2, out HTuple column2)

void HXLD.SmallestRectangle1Xld(out double row1, out double column1, out double row2, out double column2)

def smallest_rectangle1_xld(xld: HObject) -> Tuple[Sequence[float], Sequence[float], Sequence[float], Sequence[float]]

def smallest_rectangle1_xld_s(xld: HObject) -> Tuple[float, float, float, float]

描述

算子 smallest_rectangle1_xldsmallest_rectangle1_xldSmallestRectangle1XldSmallestRectangle1XldSmallestRectangle1Xldsmallest_rectangle1_xld calculates the enclosing rectangle (parallel to the coordinate axes) for each input contour or polygon. The enclosing rectangle is described by the coordinates of the corner pixels (Row1Row1Row1Row1row1row_1,Column1Column1Column1Column1column1column_1,Row2Row2Row2Row2row2row_2,Column2Column2Column2Column2column2column_2)

如果传递多个轮廓或多边形,结果将按其在 XLDXLDXLDXLDXLDxld 中的顺序存储为元组。 In case of an empty contour all parameters have the value 0 if no other behavior was set (see set_systemset_systemSetSystemSetSystemSetSystemset_system).

注意

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

执行信息

参数

XLDXLDXLDXLDXLDxld (输入对象)  xld(-array) objectHXLDHObjectHXLDHobject

待检查的轮廓或多边形。

Row1Row1Row1Row1row1row_1 (输出控制)  rectangle.origin.y(-array) HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)

Row coordinate of upper left corner point of the enclosing rectangle.

Column1Column1Column1Column1column1column_1 (输出控制)  rectangle.origin.x(-array) HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)

Column coordinate of upper left corner point of the enclosing rectangle.

Row2Row2Row2Row2row2row_2 (输出控制)  rectangle.corner.y(-array) HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)

Row coordinate of lower right corner point of the enclosing rectangle.

Column2Column2Column2Column2column2column_2 (输出控制)  rectangle.corner.x(-array) HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)

Column coordinate of lower right corner point of the enclosing rectangle.

复杂度

若 N 为等轮廓点数,则运行时间复杂度为 O(N)。

结果

smallest_rectangle1_xldsmallest_rectangle1_xldSmallestRectangle1XldSmallestRectangle1XldSmallestRectangle1Xldsmallest_rectangle1_xld 在输入不为空时返回 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>)。如有必要,则抛出异常。

可能的前趋

gen_contours_skeleton_xldgen_contours_skeleton_xldGenContoursSkeletonXldGenContoursSkeletonXldGenContoursSkeletonXldgen_contours_skeleton_xld, edges_sub_pixedges_sub_pixEdgesSubPixEdgesSubPixEdgesSubPixedges_sub_pix, threshold_sub_pixthreshold_sub_pixThresholdSubPixThresholdSubPixThresholdSubPixthreshold_sub_pix, gen_contour_polygon_xldgen_contour_polygon_xldGenContourPolygonXldGenContourPolygonXldGenContourPolygonXldgen_contour_polygon_xld

可能的后继

gen_polygons_xldgen_polygons_xldGenPolygonsXldGenPolygonsXldGenPolygonsXldgen_polygons_xld

替代

height_width_ratio_xldheight_width_ratio_xldHeightWidthRatioXldHeightWidthRatioXldHeightWidthRatioXldheight_width_ratio_xld, smallest_rectangle2_xldsmallest_rectangle2_xldSmallestRectangle2XldSmallestRectangle2XldSmallestRectangle2Xldsmallest_rectangle2_xld, shape_trans_xldshape_trans_xldShapeTransXldShapeTransXldShapeTransXldshape_trans_xld

另见

shape_trans_xldshape_trans_xldShapeTransXldShapeTransXldShapeTransXldshape_trans_xld, smallest_rectangle2_xldsmallest_rectangle2_xldSmallestRectangle2XldSmallestRectangle2XldSmallestRectangle2Xldsmallest_rectangle2_xld, smallest_circle_xldsmallest_circle_xldSmallestCircleXldSmallestCircleXldSmallestCircleXldsmallest_circle_xld, elliptic_axis_xldelliptic_axis_xldEllipticAxisXldEllipticAxisXldEllipticAxisXldelliptic_axis_xld, area_center_xldarea_center_xldAreaCenterXldAreaCenterXldAreaCenterXldarea_center_xld

模块

基础