MATLAB: Overlay binary image on RGB image

image processing

I would like to overlay the white regions of a binary image onto an RGB image. Is this possible? What about overlaying the black regions?

Best Answer

Is this?
RGB_image=imread('image_test.jpg');
subplot(311);imshow(RGB_image);
bw_image=im2bw(rgb2gray(RGB_image));
subplot(312);imshow(bw_image);
result=imfuse(RGB_image,bw_image);
subplot(313);imshow(result);
Detail documentation here
Related Question