Create mask within image
createMask is not recommended. Use the
createMask method associated with the ROI classes instead,
described in ROI Creation Overview.
BW = createMask(h)
BW = createMask(h,himage)
Create an ellipse ROI.
imshow('coins.png'); e = imellipse;
Use the mouse to reshape and reposition the ellipse. Then, create a binary mask
from the ROI. Pixels inside the ROI have the value
1, and pixels
outside the ROI have the value
0. Display the mask in a new
BW = createMask(e); figure; imshow(BW)