smallest_rectangle2_xldsmallest_rectangle2_xldSmallestRectangle2XldSmallestRectangle2Xldsmallest_rectangle2_xld(算子)

名称

smallest_rectangle2_xldsmallest_rectangle2_xldSmallestRectangle2XldSmallestRectangle2Xldsmallest_rectangle2_xld — 具有任意方向轮廓或多边形的最小包围矩形。

签名

smallest_rectangle2_xld(XLD : : : Row, Column, Phi, Length1, Length2)

Herror smallest_rectangle2_xld(const Hobject XLD, double* Row, double* Column, double* Phi, double* Length1, double* Length2)

Herror T_smallest_rectangle2_xld(const Hobject XLD, Htuple* Row, Htuple* Column, Htuple* Phi, Htuple* Length1, Htuple* Length2)

void SmallestRectangle2Xld(const HObject& XLD, HTuple* Row, HTuple* Column, HTuple* Phi, HTuple* Length1, HTuple* Length2)

void HXLD::SmallestRectangle2Xld(HTuple* Row, HTuple* Column, HTuple* Phi, HTuple* Length1, HTuple* Length2) const

void HXLD::SmallestRectangle2Xld(double* Row, double* Column, double* Phi, double* Length1, double* Length2) const

static void HOperatorSet.SmallestRectangle2Xld(HObject XLD, out HTuple row, out HTuple column, out HTuple phi, out HTuple length1, out HTuple length2)

void HXLD.SmallestRectangle2Xld(out HTuple row, out HTuple column, out HTuple phi, out HTuple length1, out HTuple length2)

void HXLD.SmallestRectangle2Xld(out double row, out double column, out double phi, out double length1, out double length2)

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

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

描述

算子 smallest_rectangle2_xldsmallest_rectangle2_xldSmallestRectangle2XldSmallestRectangle2XldSmallestRectangle2Xldsmallest_rectangle2_xld determines the smallest enclosing rectangle of each input contour or polygon, i.e., the rectangle with the smallest area of all rectangles containing the contour. For this rectangle the center, the inclination, and the two radii are calculated.

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

执行信息

参数

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

待检查的轮廓或多边形。

RowRowRowRowrowrow (输出控制)  rectangle2.center.y(-array) HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)

Row coordinate of the center point of the enclosing rectangle.

ColumnColumnColumnColumncolumncolumn (输出控制)  rectangle2.center.x(-array) HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)

Column coordinate of the center point of the enclosing rectangle.

PhiPhiPhiPhiphiphi (输出控制)  rectangle2.angle.rad(-array) HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)

Orientation of the enclosing rectangle (arc measure)

Assertion: - pi / 2 < Phi && Phi <= pi / 2

Length1Length1Length1Length1length1length_1 (输出控制)  rectangle2.hwidth(-array) HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)

First radius (half length) of the enclosing rectangle.

Assertion: Length1 >= 0.0

Length2Length2Length2Length2length2length_2 (输出控制)  rectangle2.hheight(-array) HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)

Second radius (half width) of the enclosing rectangle.

Assertion: Length2 >= 0.0 && Length2 <= Length1

复杂度

If N is the number of contour points and C is the number of points in the convex hull, the runtime complexity is O(N*ln(N)+C^2).

结果

smallest_rectangle2_xldsmallest_rectangle2_xldSmallestRectangle2XldSmallestRectangle2XldSmallestRectangle2Xldsmallest_rectangle2_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

替代

smallest_rectangle1smallest_rectangle1SmallestRectangle1SmallestRectangle1SmallestRectangle1smallest_rectangle1, shape_trans_xldshape_trans_xldShapeTransXldShapeTransXldShapeTransXldshape_trans_xld

另见

smallest_rectangle1smallest_rectangle1SmallestRectangle1SmallestRectangle1SmallestRectangle1smallest_rectangle1, smallest_circlesmallest_circleSmallestCircleSmallestCircleSmallestCirclesmallest_circle, elliptic_axis_xldelliptic_axis_xldEllipticAxisXldEllipticAxisXldEllipticAxisXldelliptic_axis_xld

模块

基础