Convert binary image to rgb image again ?is it possible?

7 views (last 30 days)
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?

Answers (2)

Image Analyst
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.).
  3 Comments

Sign in to comment.


Wouter
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.
  5 Comments
I Made
I Made on 21 Mar 2013
My method of inserting it only can work in binary.. and i think it's to big too..

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!