image segmentation
9 views (last 30 days)
Show older comments
Hey, Im trying to segment out a polygon region out of an image. I have already got the boundary pixels . Can you please help me in finding out the pixel values inside the boundary.
Thank You
0 Comments
Accepted Answer
Sean de Wolski
on 7 Mar 2011
Okay, use IMFILL or POLY2MASK to generate a logical mask and then multiply it by the image to preserve the content inside the mask. I.e.
For grayscale images:
Imasked = I.*cast(Mask,class(I));
or for RGB images:
Imasked = bsxfun(@times,I,cast(Mask,class(I)));
0 Comments
More Answers (4)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!