orientation_points_xld orientation_points_xld OrientationPointsXld OrientationPointsXld orientation_points_xld (Operator)
Name
orientation_points_xld orientation_points_xld OrientationPointsXld OrientationPointsXld orientation_points_xld
— Calculate the orientation of contours or polygons treated as point clouds.
Signature
orientation_points_xld (XLD : : : Phi )
Herror orientation_points_xld (const Hobject XLD , double* Phi )
Herror T_orientation_points_xld (const Hobject XLD , Htuple* Phi )
void OrientationPointsXld (const HObject& XLD , HTuple* Phi )
HTuple HXLD ::OrientationPointsXld () const
def orientation_points_xld (xld : HObject) -> Sequence[float]
def orientation_points_xld_s (xld : HObject) -> float
Description
The operator orientation_points_xld orientation_points_xld OrientationPointsXld OrientationPointsXld OrientationPointsXld orientation_points_xld
calculates the
orientation Phi Phi Phi Phi phi phi
of the point clouds given by the contours or
polygons XLD XLD XLD XLD XLD xld
(the order of the points in the contour or
polygon is not taken into account). The orientation Phi Phi Phi Phi phi phi
is calculated
the same way as in elliptic_axis_points_xld elliptic_axis_points_xld EllipticAxisPointsXld EllipticAxisPointsXld EllipticAxisPointsXld elliptic_axis_points_xld
. If the contour or
polygon is closed (end point = start point), the end point of the contour or
polygon is not taken into account to avoid that it receives twice
the weight of the other points.
In addition, the contour point
with maximum distance to the
center of gravity
is calculated. If the angle between the
vector
and the vector given by
Phi Phi Phi Phi phi phi
is
greater than
, the value of
is added
to the angle. If XLD XLD XLD XLD XLD xld
consists of only two points,
Phi Phi Phi Phi phi phi
is given by the direction from the first point towards
the second point.
orientation_points_xld orientation_points_xld OrientationPointsXld OrientationPointsXld OrientationPointsXld orientation_points_xld
should be used if the contour XLD XLD XLD XLD XLD xld
intersects itself or if it is not possible to close the contour using a line
from end to start point without self-intersection, because in this case
orientation_xld orientation_xld OrientationXld OrientationXld OrientationXld orientation_xld
does not produce useful results. To test whether the
contours or polygons intersect themselves,
test_self_intersection_xld test_self_intersection_xld TestSelfIntersectionXld TestSelfIntersectionXld TestSelfIntersectionXld test_self_intersection_xld
can be used.
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
.
Execution Information
Multithreading type: reentrant (runs in parallel with non-exclusive operators).
Multithreading scope: global (may be called from any thread).
Automatically parallelized on tuple level.
Parameters
XLD XLD XLD XLD XLD xld
(input_object) xld(-array) →
object HXLD HObject HXLD Hobject
Contours or polygons to be examined.
Phi Phi Phi Phi phi phi
(output_control) angle.rad(-array) →
HTuple Sequence[float] HTuple Htuple (real) (double ) (double ) (double )
Orientation of the contours or polygons (radians).
Assertion: - pi < Phi && Phi <= pi
Possible Predecessors
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
Alternatives
orientation_xld orientation_xld OrientationXld OrientationXld OrientationXld orientation_xld
,
elliptic_axis_points_xld elliptic_axis_points_xld EllipticAxisPointsXld EllipticAxisPointsXld EllipticAxisPointsXld elliptic_axis_points_xld
,
smallest_rectangle2_xld smallest_rectangle2_xld SmallestRectangle2Xld SmallestRectangle2Xld SmallestRectangle2Xld smallest_rectangle2_xld
See also
moments_region_2nd moments_region_2nd MomentsRegion2nd MomentsRegion2nd MomentsRegion2nd moments_region_2nd
Module
Foundation