How to detect watermarking in DWT~ Include matlab source~ please help me~~

조회 수: 2 (최근 30일)
how to detect watermarking??
I don't know how about detecting watermarking code
please help me!
I successed insert watermarking but I can't exctract watermark
clear all;
clc
% read gray image
gray_img = imread('body_1_gray256.jpg');
% convert double image
gray_img = double(gray_img);
init = 0.0001; %
%
[p q] = size(gray_img);
%
sign_img = imread('sign_image.jpg');
[Lo_D,Hi_D,Lo_R,Hi_R] = wfilters('haar');
[cA,cH,cV,cD] = dwt2(gray_img,Lo_D,Hi_D);
% watermarking start
y = [cA cH;cV cD];
Y = y + init*abs(y).* double(sign_img);
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
Watermarked_img = idwt2(ncA,ncH,ncV,ncD,Lo_R,Hi_R);

채택된 답변

B.k Sumedha
B.k Sumedha 2015년 6월 25일
clc
close all
%host
rgbimage=imread('host.jpg');
figure;imshow(rgbimage);title('original color image');
[h_LL,h_LH,h_HL,h_HH]=dwt2(rgbimage,'haar');
dec2d = [...
h_LL, h_LH; ...
h_HL, h_HH ...
];
figure,imshow(uint8(dec2d));title('DWT2 of original color image');
%watermark
rgbimage=imread('watermark.jpg');
figure;imshow(rgbimage);title('Watermark image');
[w_LL,w_LH,w_HL,w_HH]=dwt2(rgbimage,'haar');
dec2d = [...
w_LL, w_LH; ...
w_HL, w_HH ...
];
figure,imshow(uint8(dec2d));title('DWT2 of Watermark image');
%watermarked
rgbimage=imread('watermarked.jpg');
figure;imshow(rgbimage);title('Watermarked image');
[wm_LL,wm_LH,wm_HL,wm_HH]=dwt2(rgbimage,'haar');
dec2d = [...
wm_LL, wm_LH; ...
wm_HL, wm_HH ...
];
figure,imshow(uint8(dec2d));title('DWT2 of Watermarked image');
%watermarking
newwatermark_LL= (wm_LL-h_LL)/0.30;
%extracted watermark image
rgb2=idwt2(newwatermark_LL,w_LH,w_HL,w_HH,'haar');
figure;imshow(uint8(rgb2));title('Extracted watermark');
imwrite(uint8(rgb2),'EWatermark.jpg');
  댓글 수: 1
DoSeok Lee
DoSeok Lee 2015년 6월 26일
편집: DoSeok Lee 2015년 6월 26일
Hi~ B.k Sumedha thank you for my Question But I wonder your matlab source~
%host rgbimage=imread('host.jpg');%<-- example cameraman.tif (my file name)256x256
%watermark rgbimage=imread('watermark.jpg'); %<-- exmaple rice.tif (my file name)256x256
%watermarked rgbimage=imread('watermarked.jpg'); <-- I don't know what image insert?

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Discrete Multiresolution Analysis에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by