How to obtain an average polygon out of multiple polygon boundaries?
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Sudip Paudel
am 13 Jul. 2020
Kommentiert: Sudip Paudel
am 14 Jul. 2020
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 Kommentare
Akzeptierte Antwort
Image Analyst
am 14 Jul. 2020
I already did this for someone else. Luckily I saved the code. It's attached.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/331478/image.png)
5 Kommentare
Image Analyst
am 14 Jul. 2020
You can convert your polygons/boundaries into images with the poly2mask() function.
Weitere Antworten (0)
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!