MATLAB Answers


How can I simplify the polygon?

Asked by Tony Carl on 27 Apr 2018
Latest activity Edited by Tony Carl on 27 Apr 2018
The polygon above is got after I shrank a rectangle. However, The meaningless branches are not desired. How can I remove them and split it into polygons that are independent to each other?


For illustration, the data of the polygon and an example figure is shown below, plotted by code:
The data pack of the polygon.

Sign in to comment.

1 Answer

Answer by Ahmet Cecen on 27 Apr 2018

Well purely speculating, assuming you have a binary image with those lines:
FilledPolygons = imfill(PolygonImage,'holes');
OnlyPolygonsFilled = FilledPolygons - PolygonImage;
OnlyPolygonEdges = edge(OnlyPolygonsFilled);


Thanks a lot, when converted to an 0-1 image, it can really be much helpful for solving the problem. Is there any way to match the boundary points with the set of points on original polygon? As the algorithm of main body are based on the original data.
You will need to clarify a bit more. Maybe show your actual data etc.
An example figure and its relevant data are appended below the question.

Sign in to comment.