approximate-polygon

approximate_polygon

skimage.measure.approximate_polygon(coords, tolerance) [source]

Approximate a polygonal chain with the specified tolerance.

It is based on the Douglas-Peucker algorithm.

Note that the approximated polygon is always within the convex hull of the original polygon.

Parameters:

coords : (N, 2) array

Coordinate array.

tolerance : float

Maximum distance from original points of polygon to approximated polygonal chain. If tolerance is 0, the original coordinate array is returned.

Returns:

coords : (M, 2) array

Approximated polygonal chain where M <= N.

References

[R258] http://en.wikipedia.org/wiki/Ramer-Douglas-Peucker_algorithm
doc_scikit_image
2017-01-12 17:20:13
Comments
Leave a Comment

Please login to continue.