Error when using createMask

4 visualizaciones (últimos 30 días)
Manuel Matus
Manuel Matus el 12 de Abr. de 2019
Respondida: Brian Hart el 12 de Abr. de 2019
I am trying to develop a code in which I want to modify a figure. However, when I call createMask, I get an error saying "Undifined function or variable 'createMask'.
This is the code:
% read the original image
I = imread('TEST.PNG');
% call createMask function to get the mask and the filtered image
[BW,maskedRGBImage] = createMask(I);
% plot the original image, mask and filtered image all in one figure
subplot(1,3,1);imshow(I);title('Original Image');
subplot(1,3,2);imshow(BW);title('Mask');
subplot(1,3,3);imshow(maskedRGBImage);title('Filtered Image');
Any suggestions?

Respuestas (1)

Brian Hart
Brian Hart el 12 de Abr. de 2019
Hi Manuel,
A mask is created from an ROI (region of interest), not an image. First you need to create an ROI with drawellipse, drawfreehand, etc. Then you can create a binary mask.
See the documentation for createMask for a good example.

Etiquetas

Productos


Versión

R2017b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by