MATLAB Answers

How can I simplify the polygon?

6 views (last 30 days)
Tony Carl
Tony Carl on 27 Apr 2018
Edited: 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?
  2 Comments
Tony Carl
Tony Carl on 27 Apr 2018
The data pack of the polygon.

Sign in to comment.

Answers (1)

Ahmet Cecen
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);
  3 Comments
Tony Carl
Tony Carl on 27 Apr 2018
An example figure and its relevant data are appended below the question.

Sign in to comment.

Categories

Community Treasure Hunt

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

Start Hunting!