Code covered by the BSD License  

Highlights from
Decimate Polygon

Be the first to rate this file! 22 Downloads (last 30 days) File Size: 31.25 KB File ID: #34639
image thumbnail

Decimate Polygon

by Anton Semechko

 

17 Jan 2012 (Updated 23 Jan 2012)

Simplify a 2D closed, piecewise linear contour by specifying boundary offset tolerance.

| Watch this File

File Information
Description

Have you ever worked with 2D boundary shape representations and noticed that the same shape can be represented with reasonable accuracy by a much smaller number of points? Did you ever need to reduce the complexity of a 2D shape while retaining as many salient features as possible? If so then DecimatePoly is the function you have been looking for.

In the attached .ZIP folder you will find the primary, self-contained function titled DecimatePoly. Additionally, in the Demos folder you will find three demo files demonstrating the use of this function.

DecimatePoly_demo1: Demonstrates how to use DecimatePoly to simplify a 2D contour extracted from a binary image. Three binary images are included as examples. One of the them is shown in the screenshot. This is the only demo that requires Image Processing Toolbox to run.

DecimatePoly_demo2: Demonstrates the effectiveness of DecimatePoly in retaining sharp features.

DecimatePoly_demo3: Demonstrates how DecimatePoly can be used to improve time performance of in-polygon test at the cost of minor misclassification error.

MATLAB release MATLAB 7.11 (2010b)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (5)
19 Jan 2012 Andrii

Hi Anton. I have tried your function.
It works very well.
Do you know about some function like your but
which can simplify and after orthogonalize input set of points?

19 Jan 2012 Anton Semechko

@ Andrii, what is it you want to achieve by orthogonalizing a set of input points? Could you clarify what this operation means or perhaps provide a reference?

19 Jan 2012 Andrii

It is for building extraction from aerial images. After segmentation process boundaries are zigzag-shaped with many intrusions. I would like to simplify polygons but to maintain their essential shape. It means buildings should have orthogonal angles and small extrusions should be cut off. So I am looking for some implementation algorithm in MatLab. Like this: http://img812.imageshack.us/img812/3284/exampleus.png

19 Jan 2012 Anton Semechko

Not sure about Matlab implementation, but you can find C implementation if you follow the link provided on this page:
http://www.insight-journal.org/browse/publication/829

19 Jan 2012 Andrii

Thank you for the link.

Please login to add a comment or rating.
Updates
23 Jan 2012

updated description

Tag Activity for this File
Tag Applied By Date/Time
polygon simplification Anton Semechko 18 Jan 2012 09:03:46
polygon decimation Anton Semechko 18 Jan 2012 09:03:47
image processing Anton Semechko 18 Jan 2012 09:03:47

Contact us at files@mathworks.com