height_width_ratio_xldheight_width_ratio_xldHeightWidthRatioXldHeightWidthRatioXldheight_width_ratio_xld (算子名称)

名称

height_width_ratio_xldheight_width_ratio_xldHeightWidthRatioXldHeightWidthRatioXldheight_width_ratio_xld — Compute the width, height, and aspect ratio of the enclosing rectangle parallel to the coordinate axes of contours or polygons.

参数签名

height_width_ratio_xld(XLD : : : Height, Width, Ratio)

Herror height_width_ratio_xld(const Hobject XLD, double* Height, double* Width, double* Ratio)

Herror T_height_width_ratio_xld(const Hobject XLD, Htuple* Height, Htuple* Width, Htuple* Ratio)

void HeightWidthRatioXld(const HObject& XLD, HTuple* Height, HTuple* Width, HTuple* Ratio)

HTuple HXLD::HeightWidthRatioXld(HTuple* Width, HTuple* Ratio) const

double HXLD::HeightWidthRatioXld(double* Width, double* Ratio) const

static void HOperatorSet.HeightWidthRatioXld(HObject XLD, out HTuple height, out HTuple width, out HTuple ratio)

HTuple HXLD.HeightWidthRatioXld(out HTuple width, out HTuple ratio)

double HXLD.HeightWidthRatioXld(out double width, out double ratio)

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

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

描述

The operator height_width_ratio_xldheight_width_ratio_xldHeightWidthRatioXldHeightWidthRatioXldHeightWidthRatioXldheight_width_ratio_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) (see smallest_rectangle1_xldsmallest_rectangle1_xldSmallestRectangle1XldSmallestRectangle1XldSmallestRectangle1Xldsmallest_rectangle1_xld). Based on these values, height_width_ratio_xldheight_width_ratio_xldHeightWidthRatioXldHeightWidthRatioXldHeightWidthRatioXldheight_width_ratio_xld computes the width, height, and aspect ratio of the smallest surrounding rectangle as follows:

If more than one contour or polygon is passed, the results are stored in tuples in the same order as the respective contours or polygons in XLDXLDXLDXLDXLDxld. In case of an empty contour all parameters have the value 0 if no other behavior was set (see set_systemset_systemSetSystemSetSystemSetSystemset_system).

注意

If , RatioRatioRatioRatioratioratio is set to DBL_MAX (1.797e308).

运行信息

参数表

XLDXLDXLDXLDXLDxld (input_object)  xld(-array) objectHXLDHObjectHXLDHobject

Contours or polygons to be examined.

HeightHeightHeightHeightheightheight (output_control)  extent.y(-array) HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)

Height of the enclosing rectangle.

WidthWidthWidthWidthwidthwidth (output_control)  extent.x(-array) HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)

Width of the enclosing rectangle.

RatioRatioRatioRatioratioratio (output_control)  real(-array) HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)

Aspect ratio of the enclosing rectangle.

Complexity

If N is the number of contour points, the runtime complexity is O(N).

结果

height_width_ratio_xldheight_width_ratio_xldHeightWidthRatioXldHeightWidthRatioXldHeightWidthRatioXldheight_width_ratio_xld returns 2 ( H_MSG_TRUE) if the input is not empty. If the input is empty the behavior can be set via 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>). If necessary, an exception is raised.

可能的前置算子

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_rectangle1_xldsmallest_rectangle1_xldSmallestRectangle1XldSmallestRectangle1XldSmallestRectangle1Xldsmallest_rectangle1_xld, smallest_rectangle2_xldsmallest_rectangle2_xldSmallestRectangle2XldSmallestRectangle2XldSmallestRectangle2Xldsmallest_rectangle2_xld, shape_trans_xldshape_trans_xldShapeTransXldShapeTransXldShapeTransXldshape_trans_xld

参考其它

shape_trans_xldshape_trans_xldShapeTransXldShapeTransXldShapeTransXldshape_trans_xld, smallest_circle_xldsmallest_circle_xldSmallestCircleXldSmallestCircleXldSmallestCircleXldsmallest_circle_xld, elliptic_axis_xldelliptic_axis_xldEllipticAxisXldEllipticAxisXldEllipticAxisXldelliptic_axis_xld, area_center_xldarea_center_xldAreaCenterXldAreaCenterXldAreaCenterXldarea_center_xld

模块

Foundation