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 Version History

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 (2021). Polygon simplification (https://www.mathworks.com/matlabcentral/fileexchange/45342-polygon-simplification), MATLAB Central File Exchange. Retrieved .

Comments and Ratings (7)

Mohammad Abu-Haifa

Thank you

Jorge Sanhueza

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.

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

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!