Draw multiple regions on an image- imfreehand

前端 未结 2 1794
清酒与你
清酒与你 2021-01-20 10:22

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

2条回答
  •  爱一瞬间的悲伤
    2021-01-20 11:11

    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
    

提交回复
热议问题