File Exchange

image thumbnail

Polygon simplification

version 1.2.0.0 (9.76 KB) by Peter Bone
Simplifies a closed polygon by reducing the number of vertices to a specified number

8 Downloads

Updated 04 Feb 2014

View License

Editor's Note: This file was selected as MATLAB Central Pick of the Week

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.

Cite As

Peter Bone (2019). Polygon simplification (https://www.mathworks.com/matlabcentral/fileexchange/45342-polygon-simplification), MATLAB Central File Exchange. Retrieved .

Comments and Ratings (6)

thank you!

Federico

KIRTI K

it didn't worked for me :( i have an png image of 966x1296 resolution

Maria Moon

Adam

Didn't work without fixes:
demo line 21:
[C,h] = contour(BW, [0 1]);

reduce_poly.m add below line 78:
if len1len2 == 0
a=0;
return;
end

Matthias

Perfect! Very useful.

Updates

1.2.0.0

Significant speed up.

1.1.0.0

Fixed error referencing non-existing variable.

MATLAB Release Compatibility
Created with R2010b
Compatible with any release
Platform Compatibility
Windows macOS Linux