DWT matlab code for image watermarking

6 次查看(过去 30 天)
can any1 tell me the code for image watermarking for gray scale images in DWT domain ? i'm working on this. i've found many codes on net but they can't work properly.
  1 个评论
madhuri
madhuri 2012-4-13
I have the same problem.I also want a running code for dwt and dwt-svd matlab code for my project work.plz help me as im in a gr8 need.my id is : engr.madhuri@gmail.com

请先登录,再进行评论。

回答(1 个)

ajith
ajith 2012-9-13
function [I_W , S] = func_DWT(I, level, Lo_D, Hi_D); % Matlab implementation of SPIHT (without Arithmatic coding stage) % % Wavelet decomposition % % input: I : input image % level : wavelet decomposition level % Lo_D : low-pass decomposition filter % Hi_D : high-pass decomposition filter % % output: I_W : decomposed image vector % S : corresponding bookkeeping matrix % % please refer wavedec2 function to see more
[C,S] = func_Mywavedec2(I,level,Lo_D,Hi_D);
S(:,3) = S(:,1).*S(:,2); % dim of detail coef nmatrices
L = length(S);
I_W = zeros(S(L,1),S(L,2));
% approx part I_W( 1:S(1,1) , 1:S(1,2) ) = reshape(C(1:S(1,3)),S(1,1:2));
for k = 2 : L-1 rows = [sum(S(1:k-1,1))+1:sum(S(1:k,1))]; columns = [sum(S(1:k-1,2))+1:sum(S(1:k,2))]; % horizontal part c_start = S(1,3) + 3*sum(S(2:k-1,3)) + 1; c_stop = S(1,3) + 3*sum(S(2:k-1,3)) + S(k,3); I_W( 1:S(k,1) , columns ) = reshape( C(c_start:c_stop) , S(k,1:2) );
% vertical part
c_start = S(1,3) + 3*sum(S(2:k-1,3)) + S(k,3) + 1;
c_stop = S(1,3) + 3*sum(S(2:k-1,3)) + 2*S(k,3);
I_W( rows , 1:S(k,2) ) = reshape( C(c_start:c_stop) , S(k,1:2) );
% diagonal part
c_start = S(1,3) + 3*sum(S(2:k-1,3)) + 2*S(k,3) + 1;
c_stop = S(1,3) + 3*sum(S(2:k,3));
I_W( rows , columns ) = reshape( C(c_start:c_stop) , S(k,1:2) );
end

类别

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