ClassesClassesClassesClasses | | | | Operators

orientation_xldorientation_xldOrientationXldorientation_xldOrientationXldOrientationXld (Operator)

Name

orientation_xldorientation_xldOrientationXldorientation_xldOrientationXldOrientationXld — Orientation of contours or polygons.

Signature

orientation_xld(XLD : : : Phi)

Herror orientation_xld(const Hobject XLD, double* Phi)

Herror T_orientation_xld(const Hobject XLD, Htuple* Phi)

Herror orientation_xld(Hobject XLD, double* Phi)

Herror orientation_xld(Hobject XLD, HTuple* Phi)

double HXLD::OrientationXld() const

HTuple HXLDArray::OrientationXld() const

void OrientationXld(const HObject& XLD, HTuple* Phi)

HTuple HXLD::OrientationXld() const

void HOperatorSetX.OrientationXld(
[in] IHUntypedObjectX* XLD, [out] VARIANT* Phi)

VARIANT HXLDX.OrientationXld()

VARIANT HXLDContX.OrientationXld()

VARIANT HXLDPolyX.OrientationXld()

VARIANT HXLDParaX.OrientationXld()

VARIANT HXLDModParaX.OrientationXld()

VARIANT HXLDExtParaX.OrientationXld()

static void HOperatorSet.OrientationXld(HObject XLD, out HTuple phi)

HTuple HXLD.OrientationXld()

Description

The operator orientation_xldorientation_xldOrientationXldorientation_xldOrientationXldOrientationXld calculates the orientation of each input contour or polygon. The operator is based on elliptic_axis_xldelliptic_axis_xldEllipticAxisXldelliptic_axis_xldEllipticAxisXldEllipticAxisXld. 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. It is assumed that the contours or polygons are closed. If this is not the case orientation_xldorientation_xldOrientationXldorientation_xldOrientationXldOrientationXld will artificially close the contours or polygons.

It should be noted that orientation_xldorientation_xldOrientationXldorientation_xldOrientationXldOrientationXld 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_xldtest_self_intersection_xldTestSelfIntersectionXldtest_self_intersection_xldTestSelfIntersectionXldTestSelfIntersectionXld can be used. If the contour or polygon intersects itself, useful values for the orientation can be calculated with orientation_points_xldorientation_points_xldOrientationPointsXldorientation_points_xldOrientationPointsXldOrientationPointsXld.

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 XLDXLDXLDXLDXLDXLD.

Parallelization

Parameters

XLDXLDXLDXLDXLDXLD (input_object)  xld(-array) objectHXLDHXLDHXLDHXLDXHobject

Contours or polygons to be examined.

PhiPhiPhiPhiPhiphi (output_control)  real(-array) HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double) (double)

Orientation of the contours or polygons (radians).

Assertion: - pi < Phi && Phi <= pi

Result

The operator orientation_xldorientation_xldOrientationXldorientation_xldOrientationXldOrientationXld returns the value 2 (H_MSG_TRUE) if the input is not empty. 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>)set_system("no_object_result",<Result>)SetSystem("no_object_result",<Result>)SetSystem("no_object_result",<Result>). If necessary an exception is raised.

Possible Predecessors

gen_contours_skeleton_xldgen_contours_skeleton_xldGenContoursSkeletonXldgen_contours_skeleton_xldGenContoursSkeletonXldGenContoursSkeletonXld, edges_sub_pixedges_sub_pixEdgesSubPixedges_sub_pixEdgesSubPixEdgesSubPix, threshold_sub_pixthreshold_sub_pixThresholdSubPixthreshold_sub_pixThresholdSubPixThresholdSubPix, gen_contour_polygon_xldgen_contour_polygon_xldGenContourPolygonXldgen_contour_polygon_xldGenContourPolygonXldGenContourPolygonXld, test_self_intersection_xldtest_self_intersection_xldTestSelfIntersectionXldtest_self_intersection_xldTestSelfIntersectionXldTestSelfIntersectionXld

Alternatives

elliptic_axis_xldelliptic_axis_xldEllipticAxisXldelliptic_axis_xldEllipticAxisXldEllipticAxisXld, smallest_rectangle2_xldsmallest_rectangle2_xldSmallestRectangle2Xldsmallest_rectangle2_xldSmallestRectangle2XldSmallestRectangle2Xld

See also

moments_region_2ndmoments_region_2ndMomentsRegion2ndmoments_region_2ndMomentsRegion2ndMomentsRegion2nd

Module

Foundation


ClassesClassesClassesClasses | | | | Operators