How can I create a mask using multiple ROI?
显示 更早的评论

I have measured the size of mushrooms in an image. Now I want to create a mask using multiple ROI. I use the mask=createMask(h) command, but I can only draw one circle. Is there a way to make all those circles into a mask?
load('CircleData.mat');
for img = 35:10:55
bw_img = zeros(400,400);
figure; imshow(bw_img);
x = xcoor(:,1);
y = ycoor(:,1);
r = Radii(:,1);
x = x(any(~isnan(x),2),:);
y = y(any(~isnan(y),2),:);
r = r(any(~isnan(r),2),:);
len = length(r);
mask = {1:len};
for count = 1:1:len
h = drawellipse('Center',[x(count) y(count)],'SemiAxes',[r(count) r(count)]);
mask = createMask(h)
imshow(mask);
end
end
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 ROI-Based Processing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!