Convert binary image to rgb image again ?is it possible?
7 views (last 30 days)
Show older comments
I'm trying to convert rgb image to binary image using code i found on this website too :
Irgb = imread('wtmk.png');
threshold = 128;
Igray = rgb2gray(Irgb);
Ibw = Igray>threshold;
I wonder if i can get back to rgb image from binary image? anyone can give me advise?
Image Analyst on 20 Mar 2013
Do you want a watermarking demo, because I can give that to you for gray scale images? For color, you simply extract the 3 color channels:
redChannel = rgbImage(:, :, 1); greenChannel = rgbImage(:, :, 2); blueChannel = rgbImage(:, :, 3);
watermark each of the three color channels individually, and then recombine with cat:
watermarkedRGBImage = cat(3, watermarkedRed, watermarkedRGreen, watermarkedRBlue);
at least that's one way - I'm sure there are more sophisticated methods with hidden watermarks that are more resistant to attack (cropping, rotating, adding noise, etc.).
Wouter on 20 Mar 2013
Edited: Wouter on 20 Mar 2013
You can create a masked RGB image from the Ibw and Irgb images; by using:
Irgb_new = Irgb;
Irgb_new(~repmat((Ibw),[1 1 3])) = 0
You cannot retrieve the orginal rgb values from just Ibw.
Find more on Get Started with Image Processing Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!