Operators |
gen_polygons_xld — Approximate XLD contours by polygons.
gen_polygons_xld approximates XLD contours (Contours) by polygons. The type of the approximation can be set by Type. The threshold for the approximation is set via Alpha. The procedure is able to process open as well as closed contours. The resulting approximating XLD polygons are returned in Polygons.
Contours can be approximated by the algorithms of Ramer, Ray, and Sato. The algorithm of Ramer approximates contours such that the Euclidian distance of the approximating polygon to the contour is at most Alpha pixel units. The algorithm of Ray does not need a threshold, and hence Alpha is ignored. Here, the contour is approximated by maximizing the line length, while minimizing the sum of the distances of the line segment from the contour. The algorithm of Sato produces a polygon point at the point of the contour in which the distance to the end points of the contour is maximal. The total approximation error for each iteration is then given by (L - L')/L, where L is the Euclidian contour length, and L' is the length of the approximating polygon.
Contours to be approximated.
Approximating polygons.
Type of approximation.
Default value: 'ramer'
List of values: 'ramer' , 'ray' , 'sato'
Threshold for the approximation.
Default value: 2.0
Suggested values: 1.0, 1.5, 2.0, 3.0, 4.0
Restriction: Alpha > 0.0
gen_contours_skeleton_xld, lines_gauss, lines_facet, edges_sub_pix
gen_parallels_xld, split_contours_xld
Foundation
Operators |