DWT matlab code for image watermarking
7 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaire
madhuri
le 13 Avr 2012
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
Réponses (1)
ajith
le 13 Sep 2012
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
Voir également
Catégories
En savoir plus sur Image Analysis dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!