diameter_xld ( XLD : : : Row1, Column1, Row2, Column2, Diameter )

Maximum distance between two contour points.

The operator diameter_xld calculates the maximum distance between two contour points. The coordinates of these two extremes and the distance between them will be returned. The input contour must not intersect itself, otherwise the resulting parameters are not meaningful. If the input contour is not closed it will be closed automatically.


Attention

If the contour is empty, the results of Row1, Column1, Row2 and Column2 (all of them = 0) may lead to confusion.


Parameters

XLD (input_object)
xld(-array) -> object
Contour(s) to be examined.

Row1 (output_control)
line.begin.y(-array) -> real
Row coordinate of the first extreme point of the contour(s).

Column1 (output_control)
line.begin.x(-array) -> real
Column coordinate of the first extreme point of the contour(s).

Row2 (output_control)
line.end.y(-array) -> real
Row coordinate of the second extreme point of the contour(s).

Column2 (output_control)
line.end.x(-array) -> real
Column coordinate of the second extreme point of the contour(s).

Diameter (output_control)
number(-array) -> real
Distance of the two extreme points of the contour(s).


Result

The operator diameter_xld returns the value 2 (H_MSG_TRUE), if the input is not empty. The reaction to empty input (no input contours are available) may be determined with the help of the operator set_system('no_object_result',<Result>). If necessary an exception is raised.


Parallelization Information

diameter_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


Alternatives

smallest_rectangle2_xld


See also

area_center_xld


Module

Sub-pixel operators



Copyright © 1996-2005 MVTec Software GmbH