orientation_xld orientation_xld OrientationXld OrientationXld orientation_xld (算子)
名称
orientation_xld orientation_xld OrientationXld OrientationXld orientation_xld — 计算轮廓或多边形的方向。
签名
orientation_xld (XLD : : : Phi )
Herror orientation_xld (const Hobject XLD , double* Phi )
Herror T_orientation_xld (const Hobject XLD , Htuple* Phi )
void OrientationXld (const HObject& XLD , HTuple* Phi )
HTuple HXLD ::OrientationXld () const
def orientation_xld (xld : HObject) -> Sequence[float]
def orientation_xld_s (xld : HObject) -> float
描述
算子 orientation_xld orientation_xld OrientationXld OrientationXld OrientationXld orientation_xld calculates the orientation of
each input contour or polygon. The operator is based on
elliptic_axis_xld elliptic_axis_xld EllipticAxisXld EllipticAxisXld EllipticAxisXld elliptic_axis_xld 。In addition, the contour respectively polygon
point with maximum distance to the center of gravity is calculated. If the
column coordinate of this point is less than the column coordinate
of the center of gravity the value of
is added to the
angle.假设轮廓或多边形是闭合的。 If
this is not the case orientation_xld orientation_xld OrientationXld OrientationXld OrientationXld orientation_xld will artificially close
the contours or polygons.
需要注意的是,orientation_xld orientation_xld OrientationXld OrientationXld OrientationXld orientation_xld 仅在轮廓或多边形在平面上包围区域时才会返回有效结果。特别需要注意的是,轮廓或多边形不得自相交。当传递开放轮廓或多边形时,这一点尤为重要,因为它们会被自动闭合,从而可能产生自相交的情况。可使用 test_self_intersection_xld test_self_intersection_xld TestSelfIntersectionXld TestSelfIntersectionXld TestSelfIntersectionXld test_self_intersection_xld 检测轮廓或多边形是否自相交。 If the contour or polygon intersects itself, useful values
for the orientation can be calculated with
orientation_points_xld orientation_points_xld OrientationPointsXld OrientationPointsXld OrientationPointsXld orientation_points_xld 。
If more than one contour or polygon is passed, the values of the
orientations are stored in a tuple in the same order as the respective
contours or polygons in XLD XLD XLD XLD XLD xld 。
执行信息
多线程类型:可重入(与非独占算子并行运行)。
多线程作用域:全局(可从任何线程调用)。
在元组级别上自动并行化。
参数
XLD XLD XLD XLD XLD xld (输入对象) xld(-array) → object HXLD HObject HXLD Hobject
待检查的轮廓或多边形。
Phi Phi Phi Phi phi phi (输出控制) angle.rad(-array) → HTuple Sequence[float] HTuple Htuple (real) (double ) (double ) (double )
Orientation of the contours or polygons (radians).
Assertion:
- pi < Phi && Phi <= pi
结果
算子 orientation_xld orientation_xld OrientationXld OrientationXld OrientationXld orientation_xld 在输入不为空时返回值 2 ( H_MSG_TRUE )。The behavior in case of empty input (no input contours
available) is set via the operator
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 ,
test_self_intersection_xld test_self_intersection_xld TestSelfIntersectionXld TestSelfIntersectionXld TestSelfIntersectionXld test_self_intersection_xld
替代
elliptic_axis_xld elliptic_axis_xld EllipticAxisXld EllipticAxisXld EllipticAxisXld elliptic_axis_xld ,
smallest_rectangle2_xld smallest_rectangle2_xld SmallestRectangle2Xld SmallestRectangle2Xld SmallestRectangle2Xld smallest_rectangle2_xld
另见
moments_region_2nd moments_region_2nd MomentsRegion2nd MomentsRegion2nd MomentsRegion2nd moments_region_2nd
模块
基础