I am working with an overlayed image, where I've turned the transparency down. I would like to set a polygon ROI and display the binary mask of the ROI for the image. However, because there are multiple images in the axis, the function is throwing me an error:
"Error using images.roi.internal.mixin.CreateMask/validateInputs
Ambiguous syntax. Associated axes contains more than one image. Specify image handle as input argument to resolve ambiguity.
Error in images.roi.internal.mixin.CreateMask/createMask"
It seems like this wasn't a problem in previous versions since you could specify the image handle. Is there some way to access the roi of the different image in the Polygon object? (Matlab R2020a)
Here's some example code of what I'm trying to do:
I1 = imread('cell.tif');I2 = imread('cameraman.tif');im1 = imshow(I1,[]); hold on;im2 = imshow(I2,[]);set(im2, 'AlphaData', 0.6)roi = drawpolygon(gca);bw = roi.createMask;
Best Answer