when i apply crop attack on watermarked image it give me this error( Error in ==> extraction at 18 green = X(:,:,2);) while i embedd a watermark in blue channel how can i solve this problem? how can i apply crop attack?

when i apply crop attack on watermarked image it give me this error( Error in ==> extraction at 18 green = X(:,:,2);) while i embedd a watermark in blue channel how can i solve this problem? how can i apply crop attack?

9 Comments

Just cant u post the code here? So that it will be available for others too.
extraction code
close all
clear all
load var;
tic
%Extraction Process
X=imread('watermarkrgb.png');
% X=imrotate(X,90);
%X = imnoise(X,'salt & pepper',0.02);
% X = imnoise(X,'poisson');
% X = imnoise(X,'speckle',0.04);
% X = imnoise(X,'gaussian',0,0.025);
X=crop(X);
% figure
% imshow(X);
red = X(:,:,1);
green = X(:,:,2);
blue = X(:,:,3);
% figure
% imshow(red);
% figure
% imshow(green);
% figure
% imshow(blue);
% X=crop(X);
% X=imread('shrp2.png');
% X=imread('blur2.png');
% X = medfilt2(X);
% X = medfilt2(X, [7 7]) ;
% X=imresize(X,[256,256]);
blue=im2double(blue);
[ca1,ch1,cv1,cd1] = dwt2(blue,'haar');
[ca2,ch2,cv2,cd2] = dwt2(ca1,'haar');
[AW1,AW2,AW3,AW4 ] = Dividev2(ca2);
[u1,sW11,v1]=svd(AW1);
[u2,sW22,v2]=svd(AW2);
[u3,sW33,v3]=svd(AW3);
[u4,sW44,v4]=svd(AW4);
SW1=SU1*sW11*SV1';
SW2=SU2*sW22*SV2';
SW3=SU3*sW33*SV3';
SW4=SU4*sW44*SV4';
for i=1:x
for j=1:y
P1(i,j)= (SW1(i,j) - St1(i,j) )/ 0.3 ;
end
end
for i=1:x
for j=1:y
P2(i,j)= (SW2(i,j) - st2(i,j) )/ 0.3 ;
end
end
for i=1:x
for j=1:y
P3(i,j)= (SW3(i,j) - st3(i,j) )/ 0.3 ;
end
end
for i=1:x
for j=1:y
P4(i,j)= (SW4(i,j) - st4(i,j) )/ 0.3 ;
end
end
% figure
% imshow(P1);title('p1')
% figure
% imshow(P2);title('p2')
% figure
% imshow(P3);title('p3')
% figure
% imshow(P4);title('p4')
P=Combine(P1,P3,P2,P4); % call combine function
% figure
% imshow(P)
P=repermutV2(P); % rearrange the image.
figure
imshow(P);title('Extracted watermark');
% E = uint8(255*W);
F = uint8(255*P);
t=toc
function for crop....
function [ crp ] = crop( A )
%UNTITLED Summary of this function goes here
% Detailed explanation goes here
for i=1:430
for j=1:430
crp(i,j)=A(i,j);
end
end
No, I do not understand the code. Please insert it in the body of the question, not as a comment, and care for a proper formatting. Currently it cannot be read reliably.

Answers (0)

This question is closed.

Asked:

on 28 May 2015

Closed:

on 28 May 2015

Community Treasure Hunt

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

Start Hunting!