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

10 ビュー (過去 30 日間)
Sudip Paudel
Sudip Paudel 2020 年 7 月 13 日
コメント済み: Sudip Paudel 2020 年 7 月 14 日
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 件)

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by