diameter_xld — Maximum distance between two contour or polygon points.
The operator diameter_xld calculates the maximum distance between two points of each input contour or polygon. The coordinates of these two extremes and the distance between them will be returned. The input contour or polygon must not intersect itself, otherwise the resulting parameters are not meaningful (Whether the input contour or polygon intersects itself or not can be determined with test_self_intersection_xld). If the input contour or polygon is not closed it will be closed automatically. 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.
If the contour or polygon is empty, the results of Row1, Column1, Row2 and Column2 (all of them = 0) may lead to confusion.
Contours or polygons to be examined.
Row coordinate of the first extreme point of the contours or polygons.
Column coordinate of the first extreme point of the contours or polygons.
Row coordinate of the second extreme point of the contour or polygons.
Column coordinate of the second extreme point of the contours or polygons.
Distance of the two extreme points of the contours or polygons.
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.
gen_contours_skeleton_xld, edges_sub_pix, threshold_sub_pix, gen_contour_polygon_xld, test_self_intersection_xld