how to do masking of color image?

HI,
How to do masking for the color image;
thanks

 Accepted Answer

Here's how to mask an RGB image with a logical mask image (courtesy of Sean de Wolski):
% Mask the image using bsxfun() function
maskedRgbImage = bsxfun(@times, rgbImage, cast(mask, class(rgbImage)));

6 Comments

Maybe later today when I get time...
Wow, there is a ton wrong with that code. I did improve the draw inner code, and it's attached, but there is still a bunch that's not really good with the program that I didn't have time to fix. See attached.
Thank you .... it is working perfectly
I don't know what multiple regions means. Do you want to erase regions of the first outline, making "holes" in the region? You can use plot() to display the regions you drew if you want to.
Hi Image analyst,
can you please remove the attached file as it should be confidential..
thank you...

Sign in to comment.

More Answers (0)

Categories

Find more on Images in Help Center and File Exchange

Tags

No tags entered yet.

Community Treasure Hunt

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

Start Hunting!