height_width_ratio_xld height_width_ratio_xld HeightWidthRatioXld HeightWidthRatioXld height_width_ratio_xld (算子)
名称
height_width_ratio_xld height_width_ratio_xld HeightWidthRatioXld HeightWidthRatioXld height_width_ratio_xld — 计算平行于轮廓或多边形坐标轴的封闭矩形的宽度、高度和纵横比。
签名
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 )
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]
描述
算子 height_width_ratio_xld height_width_ratio_xld HeightWidthRatioXld HeightWidthRatioXld HeightWidthRatioXld height_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
(Row1 Row1 Row1 Row1 row1 row_1 ,Column1 Column1 Column1 Column1 column1 column_1 ,Row2 Row2 Row2 Row2 row2 row_2 ,Column2 Column2 Column2 Column2 column2 column_2 )
(see smallest_rectangle1_xld smallest_rectangle1_xld SmallestRectangle1Xld SmallestRectangle1Xld SmallestRectangle1Xld smallest_rectangle1_xld ). Based on these values,
height_width_ratio_xld height_width_ratio_xld HeightWidthRatioXld HeightWidthRatioXld HeightWidthRatioXld height_width_ratio_xld computes the width, height, and
aspect ratio of the smallest surrounding rectangle as follows:
如果传递多个轮廓或多边形,结果将按其在 XLD XLD XLD XLD XLD xld 中的顺序存储为元组。 In case of an empty contour all parameters
have the value 0 if no other behavior was set (see
set_system set_system SetSystem SetSystem SetSystem set_system ).
注意
If
, Ratio Ratio Ratio Ratio ratio ratio is set
to DBL_MAX (1.797e308).
执行信息
多线程类型:可重入(与非独占算子并行运行)。
多线程作用域:全局(可从任何线程调用)。
在元组级别上自动并行化。
参数
XLD XLD XLD XLD XLD xld (输入对象) xld(-array) → object HXLD HObject HXLD Hobject
待检查的轮廓或多边形。
Height Height Height Height height height (输出控制) extent.y(-array) → HTuple Sequence[float] HTuple Htuple (real) (double ) (double ) (double )
Height of the enclosing rectangle.
Width Width Width Width width width (输出控制) extent.x(-array) → HTuple Sequence[float] HTuple Htuple (real) (double ) (double ) (double )
Width of the enclosing rectangle.
Ratio Ratio Ratio Ratio ratio ratio (输出控制) real(-array) → HTuple Sequence[float] HTuple Htuple (real) (double ) (double ) (double )
Aspect ratio of the enclosing rectangle.
复杂度
若 N 为等轮廓点数,则运行时间复杂度为 O(N)。
结果
height_width_ratio_xld height_width_ratio_xld HeightWidthRatioXld HeightWidthRatioXld HeightWidthRatioXld height_width_ratio_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_xld gen_contours_skeleton_xld GenContoursSkeletonXld GenContoursSkeletonXld GenContoursSkeletonXld gen_contours_skeleton_xld ,
edges_sub_pix edges_sub_pix EdgesSubPix EdgesSubPix EdgesSubPix edges_sub_pix ,
threshold_sub_pix threshold_sub_pix ThresholdSubPix ThresholdSubPix ThresholdSubPix threshold_sub_pix ,
gen_contour_polygon_xld gen_contour_polygon_xld GenContourPolygonXld GenContourPolygonXld GenContourPolygonXld gen_contour_polygon_xld
可能的后继
gen_polygons_xld gen_polygons_xld GenPolygonsXld GenPolygonsXld GenPolygonsXld gen_polygons_xld
替代
smallest_rectangle1_xld smallest_rectangle1_xld SmallestRectangle1Xld SmallestRectangle1Xld SmallestRectangle1Xld smallest_rectangle1_xld ,
smallest_rectangle2_xld smallest_rectangle2_xld SmallestRectangle2Xld SmallestRectangle2Xld SmallestRectangle2Xld smallest_rectangle2_xld ,
shape_trans_xld shape_trans_xld ShapeTransXld ShapeTransXld ShapeTransXld shape_trans_xld
另见
shape_trans_xld shape_trans_xld ShapeTransXld ShapeTransXld ShapeTransXld shape_trans_xld ,
smallest_circle_xld smallest_circle_xld SmallestCircleXld SmallestCircleXld SmallestCircleXld smallest_circle_xld ,
elliptic_axis_xld elliptic_axis_xld EllipticAxisXld EllipticAxisXld EllipticAxisXld elliptic_axis_xld ,
area_center_xld area_center_xld AreaCenterXld AreaCenterXld AreaCenterXld area_center_xld
模块
基础