Professional Documents
Culture Documents
Attacks
Encoder Decoder
35 45 20
43 64 52
10 29 39
Digital Color Images
xR [n1 , n2 ]
xG [n1 , n2 ]
xB [n1 , n2 ]
Color image
– Can be represented by three functions, R(x,y) for
red, G(x,y) for green, and B(x,y) for blue.
Classification
Watermarking Domain
• Spatial Domain Watermarking
LSB Replacement Method
Binary watermark
LSB Replacement Code
• clc
• w_mark=imread('newlogobinary.tif'); %%read watermark
• [H W]=size(w_mark); %%size of watermark
• imshow(w_mark); %%show watermark
• img=imread('lena_gray.tif'); %%read host/cover image
• wimg=img; %% creating alias image of original
• %%%%%%%%%%watermark embedding%%%%%%%%%%%%%%%%%%%%
• for i=1:H
• for j=1:W
• a=img(i,j);
• z = dec2bin(a,8); %% decimal to binary conversion with 8 bits
• z1=w_mark(i,j);
• z(8)= dec2bin(z1,1); %%LSB replacement with watermark bit
• wimg(i,j) = bin2dec(z); %% binary to decimal conversion
• end
• end
• imwrite(wimg,'watermarked_lena.jpg','jpg','quality',100); %%writing the watermark
image
LSB Replacement Code(contd.)
• %%%Different attacks
• % img1=medfilt2(img1);
• % img1=imnoise(img1,'gaussian', 0.001);
• % img1=imnoise(img1,'salt & pepper', 0.001);
Original watermark
Watermarked Image
Extracted Watermark
Original Image
Recovered Watermark
LSB Observations and Results
• The LSB plane and plane next to LSB contains practically no visually
significant information.