Hi
I'm a beginner in matlab & image processing filed. i'm concerned about image watermarking using DWT.
some time i find piece of codes uploaded on websites, regarding this subject, but my problem is that most of these coded are not well commented and the author is anonymous ... i can't understand interpret the algorithm, or why he looped here, or added those numbers or reshaped the matrix .... and all my work is dependent on writing matlab codes, i dunno how can i understand a written code without knowing its real algorithm or its based equations, for an experienced eye it could be easy but for me it's such a rocket science ...
I'm Realizing that my question could be not related to the Matlab forum but i need the help of the expert in here. and your experience
this is a piece of code i dont understand its algorithm
% Read the watermark
w=imread('watermark.jpg');
figure
imshow(w)
title('The original watermark');
% Watermark scrambling
Ln=10;
w=Arnold(w,Ln); % this calls a custom function called arnold to do image scrambling
figure
imshow(w)
title('Watermark scrambling');
% Bit graph decomposition
wb=Bitdecom(w); % i dont understand this part and (it's a custom function i will write it below)
% Recombination (what that part does?)
wb1=[wb(:,:,1) wb(:,:,2) wb(:,:,3) wb(:,:,4)];
wb2=[wb(:,:,5) wb(:,:,6) wb(:,:,7) wb(:,:,8)];
wb3=[wb1;wb2];
% Binary data stream into
wbs=reshape(wb3,1,64*64*8); % why he did that ?

function a=Bitdecom(o) (what does this function do & why ?)
L=size(o);
for i=1:L(1)
for j=1:L(2)
n=o(i,j);
for k=1:8
a(i,j,k)=mod(n,2);
n=(nmod(n,2))/2;
end
end
end
this is a part of a code ... i hope i have made my point clear thanx ... and looking for your help thanx
