MATLAB Answers

Ann G

Impoly to choose all the ROI

Asked by Ann G
on 2 Oct 2015
Latest activity Commented on by Image Analyst
on 6 Oct 2015
Hello! I would like to ask, how can I use impoly to choose all the ROI and not just the polygon that is around it!


Sign in to comment.

1 Answer

Answer by Adam
on 2 Oct 2015
Edited by Adam
on 2 Oct 2015
 Accepted Answer

mask = createMask( hROI, hIm );
should give you a binary mask for the region, where hROI is your impoly and hIm is the handle of image on which it was drawn.


Ann G
on 6 Oct 2015
Thank u for your help but unfortunately i still have a problem because i dont want a mask. Using mask as a return I get 0s and 1s and I need the elements of the ROI as they are!
This will apply the mask to the original image to erase the original pixels everywhere outside the mask:
% Initialize output to be same as input.
maskedImage = grayImage;
% Now erase pixels outside the mask.
maskedImage(~mask) = 0;

Sign in to comment.