how to embed a watermark in a color image
3 次查看(过去 30 天)
显示 更早的评论
i=imread('golf.jpg'); imshow(i); j=rgb2gray(i); imshow(j); n=imread('copy.jpg'); l=imresize(n,0.5); m=rgb2gray(l); imshow(m); [r,c]=size(j); startrow=1; startcol=1; j(startrow:startrow+size(m,1)-1,startcol:startcol+size(m,2)-1) = m; imshow(j); i used this code for watermarking a grayscale image and i can embed the watermark anywhere by replacing the values but it doesnot work for color images how can i watermark a color image?
0 个评论
回答(2 个)
Image Analyst
2013-4-14
You can do that same thing in every color channel.
% Extract the individual red, green, and blue color channels.
redChannel = rgbImage(:, :, 1);
greenChannel = rgbImage(:, :, 2);
blueChannel = rgbImage(:, :, 3);
% Now put in watermark, then recombine
newRGBImage = cat(3,watermarkedRed, watermarkedGreen, watermarkedBlue);
4 个评论
SUBROTO KUNDU
2019-7-24
Hi Image Analyst,
I have tried several times to write the code. But it does not give the correct output. Please help me.
https://www.mathworks.com/matlabcentral/answers/473297-reversible-watermarking-based-on-binomial-transform-and-cholesky-decomposition
Image Analyst
2019-7-26
But you didn't answer my two questions. And I'd have to research it just like you would, but since it's your project, not mine, and it will probably take more than about 5 minutes, I can't afford to donate that much time to you. Sorry. I'm sure you'd do just as good a job of delving into the intricate details as I could.
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!