how I can insert a simple message on a picture ??
2 views (last 30 days)
Show older comments
mohamed yassine ben homrane
on 27 Apr 2015
Commented: mohamed yassine ben homrane
on 28 Apr 2015
%this is the code to create a watermark image with key :
clc;clear all;close all;
img = imread('C:\Users\yassine\Desktop\wmark\home.jpg');
img = rgb2gray(img);
img = double(img);
c = 0.01; %Initialise the weight of Watermarking
figure,imshow(uint8(img)),title('Original Image');
[p q] = size(img);
%Generate the key
n = awgn(img,4,3,'linear');
N = imabsdiff(n,img);
figure,imshow(double(N)),title('Key');
[Lo_D,Hi_D,Lo_R,Hi_R] = wfilters('haar');
[ca,ch,cv,cd] = dwt2(img,Lo_D,Hi_D);
%Perform the watermarking
y = [ca ch;cv cd]; Y = y + c*abs(y).* N;
p=p/2;q=q/2; for i=1:p for j=1:q nca(i,j) = Y(i,j); ncv(i,j) = Y(i+p,j); nch(i,j) = Y(i,j+q); ncd(i,j) = Y (i+p,j+q); end end
wimg = idwt2(nca,nch,ncv,ncd,Lo_R,Hi_R);
figure,imshow(uint8(wimg)),title('Watermarked Image');
diff = imabsdiff(wimg,img);
figure,imshow(double(diff));title('Differences');
%but the key is used to protect the message so how I can insert my own msg(HELLO) in the image (regardless spatial domain or frequentiel)
0 Comments
Accepted Answer
Image Analyst
on 28 Apr 2015
Attached is my watermarking demo. It's sort of hidden watermarking - a primitive form of steganography. Do you require your message to be hidden or encrypted?
More Answers (1)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!