How to obtain an average polygon out of multiple polygon boundaries?

조회 수: 4 (최근 30일)
Hi, How do I obtain an average ROI from multiple ROIs drawn on different images? Thank you very much for your help.
Images=dir("*ExampleImage.tif");
S_Boundaries=[];
for i=1 :numel(Images)
Image=imread(Images(i).name);
imshow(Image);
p=drawpolygon();
S_boundary{i}=p.Position
S_Boundaries=[S_Boundaries; S_boundary{i}]
end
AverageBoundary = HelpFunction(S_Boundaries)
%HelpFunction would compute an average boundary from multiple boundaries saved as S_Boundaries.
  댓글 수: 2
Matt J
Matt J 2020년 7월 14일
Do you have a definition for "average boundary"?
Sudip Paudel
Sudip Paudel 2020년 7월 14일
  • Hi Matt, the average boundary meaning the one that represents the entire set of boundaries (I think a best fit boundary would work). Thank you.

댓글을 달려면 로그인하십시오.

채택된 답변

Image Analyst
Image Analyst 2020년 7월 14일
I already did this for someone else. Luckily I saved the code. It's attached.
  댓글 수: 5
Image Analyst
Image Analyst 2020년 7월 14일
You can convert your polygons/boundaries into images with the poly2mask() function.
Sudip Paudel
Sudip Paudel 2020년 7월 14일
Oh OK, thank you very much.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Images에 대해 자세히 알아보기

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by