How can I simplify the polygon?

5 ビュー (過去 30 日間)
Tony Carl
Tony Carl 2018 年 4 月 27 日
編集済み: Tony Carl 2018 年 4 月 27 日
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 件のコメント
Tony Carl
Tony Carl 2018 年 4 月 27 日
編集済み: Tony Carl 2018 年 4 月 27 日
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 件)

Ahmet Cecen
Ahmet Cecen 2018 年 4 月 27 日
Well purely speculating, assuming you have a binary image with those lines:
FilledPolygons = imfill(PolygonImage,'holes');
OnlyPolygonsFilled = FilledPolygons - PolygonImage;
OnlyPolygonEdges = edge(OnlyPolygonsFilled);
  3 件のコメント
Ahmet Cecen
Ahmet Cecen 2018 年 4 月 27 日
You will need to clarify a bit more. Maybe show your actual data etc.
Tony Carl
Tony Carl 2018 年 4 月 27 日
An example figure and its relevant data are appended below the question.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeElementary Polygons についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by