Name
elliptic_axis_xld elliptic_axis_xld EllipticAxisXld EllipticAxisXld — Parameters of the equivalent ellipse of contours or polygons.
Herror elliptic_axis_xld (const Hobject XLD , double* Ra , double* Rb , double* Phi )
Herror T_elliptic_axis_xld (const Hobject XLD , Htuple* Ra , Htuple* Rb , Htuple* Phi )
void EllipticAxisXld (const HObject& XLD , HTuple* Ra , HTuple* Rb , HTuple* Phi )
HTuple HXLD ::EllipticAxisXld (HTuple* Rb , HTuple* Phi ) const
double HXLD ::EllipticAxisXld (double* Rb , double* Phi ) const
The operator elliptic_axis_xld elliptic_axis_xld EllipticAxisXld EllipticAxisXld EllipticAxisXld calculates the radii and the
orientations of the ellipses having the same orientation and the same
aspect ratio as the input contours or polygons.
The length of the major radius
Ra Ra Ra Ra ra and the minor radius Rb Rb Rb Rb rb as well as the
orientation of the main axis with regard to the horizontal
(Phi Phi Phi Phi phi ) are determined. The angle is indicated in radians.
It is assumed that the contours or polygons are closed. If this is
not the case area_center_xld area_center_xld AreaCenterXld AreaCenterXld AreaCenterXld will artificially close the
contours or polygons.
Calculation:
If the moments
,
and
are
normalized and passed to the area (see moments_xld moments_xld MomentsXld MomentsXld MomentsXld ),
the radii Ra Ra Ra Ra ra and Rb Rb Rb Rb rb are calculated as:
The orientation Phi Phi Phi Phi phi is defined by:
It should be noted that elliptic_axis_xld elliptic_axis_xld EllipticAxisXld EllipticAxisXld EllipticAxisXld only returns
useful results if the contour or polygon encloses a region in the
plane. In particular, the contour or polygon must not intersect
itself. This is particularly important if open contours or polygons
are passed because they are closed automatically, which can produce
a self-intersection. To test whether the contours or polygons
intersect themselves, test_self_intersection_xld test_self_intersection_xld TestSelfIntersectionXld TestSelfIntersectionXld TestSelfIntersectionXld can be
used. If the contour or polygon intersects itself, useful values
for the ellipse parameters can be calculated with
elliptic_axis_points_xld elliptic_axis_points_xld EllipticAxisPointsXld EllipticAxisPointsXld EllipticAxisPointsXld .
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
XLD XLD XLD XLD XLD .
Multithreading type: reentrant (runs in parallel with non-exclusive operators).
Multithreading scope: global (may be called from any thread).
Automatically parallelized on tuple level.
Contours or polygons to be examined.
Major radius.
Assertion: Ra >= 0.0
Minor radius.
Assertion: Rb >= 0.0 && Rb <= Ra
Angle between the major axis and the x axis
(radians).
Assertion: - pi / 2 < Phi && Phi <= pi / 2
If N is the number of contour or polygon points, the runtime complexity is
O(N).
elliptic_axis_xld elliptic_axis_xld EllipticAxisXld EllipticAxisXld EllipticAxisXld 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>) . If
necessary, an exception is raised.
gen_contours_skeleton_xld gen_contours_skeleton_xld GenContoursSkeletonXld GenContoursSkeletonXld GenContoursSkeletonXld ,
edges_sub_pix edges_sub_pix EdgesSubPix EdgesSubPix EdgesSubPix ,
threshold_sub_pix threshold_sub_pix ThresholdSubPix ThresholdSubPix ThresholdSubPix ,
gen_contour_polygon_xld gen_contour_polygon_xld GenContourPolygonXld GenContourPolygonXld GenContourPolygonXld ,
test_self_intersection_xld test_self_intersection_xld TestSelfIntersectionXld TestSelfIntersectionXld TestSelfIntersectionXld
area_center_xld area_center_xld AreaCenterXld AreaCenterXld AreaCenterXld ,
gen_ellipse_contour_xld gen_ellipse_contour_xld GenEllipseContourXld GenEllipseContourXld GenEllipseContourXld
elliptic_axis_points_xld elliptic_axis_points_xld EllipticAxisPointsXld EllipticAxisPointsXld EllipticAxisPointsXld ,
smallest_rectangle2 smallest_rectangle2 SmallestRectangle2 SmallestRectangle2 SmallestRectangle2
moments_xld moments_xld MomentsXld MomentsXld MomentsXld ,
smallest_circle_xld smallest_circle_xld SmallestCircleXld SmallestCircleXld SmallestCircleXld ,
smallest_rectangle1_xld smallest_rectangle1_xld SmallestRectangle1Xld SmallestRectangle1Xld SmallestRectangle1Xld ,
smallest_rectangle2_xld smallest_rectangle2_xld SmallestRectangle2Xld SmallestRectangle2Xld SmallestRectangle2Xld ,
shape_trans_xld shape_trans_xld ShapeTransXld ShapeTransXld ShapeTransXld
R. Haralick, L. Shapiro
“Computer and Robot Vision”
Addison-Wesley, 1992, pp. 73-75
Foundation