How can I simplify the polygon?

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?

2 个评论

For illustration, the data of the polygon and an example figure is shown below, plotted by code:
plot(data(:,1),data(:,2),'bo-');
Tony Carl
Tony Carl 2018-4-27
编辑:Tony Carl 2018-4-27
The data pack of the polygon.

请先登录,再进行评论。

回答(1 个)

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

3 个评论

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.

请先登录,再进行评论。

类别

帮助中心File Exchange 中查找有关 Polar Plots 的更多信息

提问:

2018-4-27

编辑:

2018-4-27

Community Treasure Hunt

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

Start Hunting!

Translated by