Create mask within image
createMask
is not recommended. Use the
createMask
object function associated with the new ROI objects
instead, described in Compatibility Considerations.
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
figure.
BW = createMask(e); figure; imshow(BW)