I\'d like to manually draw multiple regions on an image to create a binary mask of the drawn regions (ground truth).
I attached the code to do it using imfreehand th
As a complement to the answer given by @Shai, you can also use the input()
function in Matlab to prompt the user for the total number of masks needed or simply as a yes/no question in a while loop.
That is, either:
imshow(img,[]) %display image to determine number of masks needed
n = input('How many masks are needed? ') %Ask user for number of masks needed
for i=1:n
create multiple masks...
end
or
n=1;
while(n==1)
create mask ...
n = input('Need more masks? [0=No, 1=Yes] ')
end