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 that does the job for one region, but once in release the mouse button, binary mask for that single region is displayed. Is there a way to draw multiple regions and then display the binary mask? (Calling imfreehand multiple times may not work because the number of regions varies with each image).
h= imfreehand();
h = imfreehand(gca);
setColor(h,'red');
position = wait(h);
BW = createMask(h);
figure,imshow(BW);
axis on;
Thanks.