Orientation of a contour.
The operator orientation_xld calculates the orientation of the input contour. The operator is based on elliptic_axis_xld. In addition, the contour 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. The input contour must not intersect itself, otherwise the resulting parameter is not meaningful. If the input contour is not closed it will be closed automatically.
If more than one contour is passed the results are stored in tuples, the index of a value in the tuple corresponding to the index of a contour in the input.
|
XLD (input_object) |
xld(-array) -> object |
| Contour(s) to be examined. | |
|
Phi (output_control) |
real(-array) -> real |
| Orientation of the contour(s) (radians). | |
| Assertion: ((- pi / 2) < Phi) && (Phi <= ((3 * pi) / 2)) | |
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.
orientation_xld is reentrant and automatically parallelized (on tuple level).
gen_contours_skeleton_xld, edges_sub_pix, threshold_sub_pix, gen_contour_polygon_xld
elliptic_axis_xld, smallest_rectangle2_xld
Sub-pixel operators