Got Questions? Get Answers.
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
I need your help in this implementation (Image Cross-Correlation)

Subject: I need your help in this implementation (Image Cross-Correlation)

From: Twilighter

Date: 12 Jun, 2011 22:30:20

Message: 1 of 1


here is my Code ...

i have a watermarked image, and i add additive gaussian noise with zero mean & (different) variance values to it then correlate it with the original watermark to make some measurement ...

the side info is the Watermark image

sideinfo_h=reshape(sideinfo_h,1,256*256);
sideinfo_v=reshape(sideinfo_v,1,256*256);

% initalize message to all ones
message_vector=ones(1,256*256);

[cA1,cH1,cV1,cD1] = dwt2(watermarked_image,'haar');

cH1 = reshape(cH1,1,256*256);
cV1 = reshape(cV1,1,256*256);

% The computed detection value ( Correlation between the watermark image & the subbands which i actually embedded the watermark in them )

ccH1= zeros(1,256*256);
ccV1= zeros(1,256*256);

for (KK=1:length(message_vector))
    
        ccH1(KK)=cH1(KK)*sideinfo_h(KK);
        ccV1=ccV1+cV1(KK)*sideinfo_v(KK);
end

P= (1/3*256*256)*(ccH1+ccV1);
Ptotal =abs(sum(P));
P_img = reshape(P,256,256);
imshow(P_img,[])
title('Image Correlation')


% Other Method to perform correlation between Watermark & watermarked Image
% nearly the same value as Ptotal
cross_correlation_h = xcorr(cH1,sideinfo_h)
cross_correlation_v = xcorr(cV1,sideinfo_v)
cross_correlation = (1/3*256*256)*((cross_correlation_h+cross_correlation_h));
cross_correlation = sum(cross_correlation);


so now that's how i calculate the threshold too

% The computed Threshold value value
ccHThr= zeros(1,256*256);
ccVThr= zeros(1,256*256);
for (KK=1:length(message_vector))
    
        ccHThr(KK)=ccHThr(KK)+(cH1(KK))^2;
        ccVThr(KK)=ccVThr(KK)+(cV1(KK))^2;
end


T1=(1/(3*256*256)^2) *sum(ccHThr+ccVThr)
T = 3.97*sqrt(2*T1)

here is a link to the equations implement here .... and the output values

https://picasaweb.google.com/105826940471714630965/Jun132011?authkey=Gv1sRgCJjQ_IeY5eWhrAE#5617463216234100178

and the outputs
X: for Additive Gaussian noise of mean zero & variance equal to X
Y1 = Image response the first equation
Y2 = Threshold

what i need to know is it normal to have way far values between threshold & the Image Response (Correlation between the image & watermark) ?? it seems the that Image response value isn't supposed to be that big

am i correctly interpreting those equations i need to know if my code is correctly implementing those image in the attached picture? they are simple but i'm just beginner i may have not put them correct.

Waiting your positive response ...

i appreciate your guidance through this

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us