HALCON Reference Manual / XLD / Features Operators

orientation_xld (Operator)

Name

orientation_xld — Orientation of contours or polygons.

Synopsis

orientation_xld(XLD : : : Phi)

Description

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

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

Parameters

XLD (input_object) xld(-array) object
Contours or polygons to be examined.

Phi (output_control) real(-array) (real)
Orientation of the contours or polygons (radians).
Assertion: (- pi < Phi) && (Phi <= pi)

Result

The operator orientation_xld 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>). If necessary an exception is raised.

Parallelization Information

orientation_xld is reentrant and automatically parallelized (on tuple level).

Possible Predecessors

gen_contours_skeleton_xld, edges_sub_pix, threshold_sub_pix, gen_contour_polygon_xld, test_self_intersection_xld

Alternatives

elliptic_axis_xld, smallest_rectangle2_xld

See also

moments_region_2nd

Module

Foundation


HALCON Reference Manual / XLD / Features Operators
Version 9.0.2 Copyright © 1996-2010 MVTec Software GmbH