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?
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.).