Reduce the number of vertices in a closed polygon while maintaining the shape and detail as much as possible.
Unlike similar functions, this one will allow you to reduce to a specific number of vertices.
Peter Bone (2021). Polygon simplification (https://www.mathworks.com/matlabcentral/fileexchange/45342-polygon-simplification), MATLAB Central File Exchange. Retrieved .
it didn't worked for me :( i have an png image of 966x1296 resolution
Didn't work without fixes:
demo line 21:
[C,h] = contour(BW, [0 1]);
reduce_poly.m add below line 78:
if len1len2 == 0
Perfect! Very useful.
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!