Watermark Embedding Process
1. Apply RDWT (Redundant DWT) to original image
2.Apply SVD to the LL sub-band of Original image
3.Apply RDWT to the watermark image.
4.Apply SVD to the LL Sub-band of watermark image
5.Modify the singular values of the original image with the singular values of the watermark image
6.Apply inverse SVD on the transformed original image with modified singular values.
7.Apply inverse RDWT to obtain the watermarked image.
Watermark Extraction Process
1.Apply RDWT on the watermarked image.
2.Apply SVD to the LL sub-band of the watermarked image.
3.Extract the singular values of watermark image from the singular values of watermarked image and original image.
4.Apply inverse SVD
5.Apply inverse RDWT to obtain the watermark image.
Matlab code is given below
Embedding
clc
clear all
close all
warning off
alpha = 0.25;
input_img = imread('lena512.bmp'); % read input image
[LL,LH,HL,HH] = dwt2(input_img,'haar','mode','sym'); % applying redundant DWT
[I_u,I_s,I_v] = svd(LL); % extract sigular values...
water_img = imread('cameraman.bmp'); % read watermark image
[WLL,WLH,WHL,WHH] = dwt2(water_img,'haar','mode','sym'); % applying redundant DWT
[W_u,W_s,W_v] = svd(WLL); % extract sigular values...
S_n = I_s + (alpha*W_s); %Watermark Embedding
new_LL = I_u*S_n*I_v'; %Watermarked Image Construction
new_img = idwt2(new_LL,LH,HL,HH,'haar','mode','sym');
new_img=uint8(new_img);
imwrite(new_img,'Watermarked.bmp');
Extraction
clc
clear all
close all
warning off
alpha = 0.25;
water_img = imread('Watermarked.bmp'); % read watermarked image
[WMLL,WMLH,WMHL,WMHH] = dwt2(water_img,'haar','mode','sym'); % applying redundant DWT
[Wm_u,Wm_s,Wm_v] = svd(WMLL); % extract sigular values...
input_img = imread('lena512.bmp'); % read input image
[LL,LH,HL,HH] = dwt2(input_img,'haar','mode','sym'); % applying redundant DWT
[I_u,I_s,I_v] = svd(LL); % extract sigular values...
S_w= (Wm_s-I_s)/alpha; % Watermark extraction
watermark=imread('cameraman.bmp');
[WLL,WLH,WHL,WHH] = dwt2(watermark,'haar','mode','sym'); % applying redundant DWT
[W_u,W_s,W_v] = svd(WLL); % extract sigular values...
new_WLL=W_u*S_w*W_v';
Watermark_img=idwt2(new_WLL,WLH,WHL,WHH,'haar','mode','sym');
Watermark_img=uint8(Watermark_img);
imwrite(Watermark_img, 'Watermark_img.bmp');
Related Search: Watermarking matlab code , Digital Watermarking RDWT matlab code ,SVD based Watermarking matlab code.Matlab watermark embedding and extraction.