How can I simplify the polygon?

조회 수: 4 (최근 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 CenterFile Exchange에서 Elementary Polygons에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by