Error when using createMask
2 ビュー (過去 30 日間)
古いコメントを表示
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?
0 件のコメント
回答 (1 件)
Brian Hart
2019 年 4 月 12 日
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.
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!