Professional Documents
Culture Documents
5.5..1 INTRODUCTION
The following Matlab code is executed on Microsoft windows XP professional version
2002 with intel ( R) Pentium ( R) D CPU 3.00GHZ 3.01GHZ and 1GB RAM system and
the Matlab software version used is 7.0.
33
DETECTION OF COPY MOVE FORGERY IN DIGITAL IMAGES
CHAPTER-5 IMPLEMENTATION DETAILS
C3=B8';
C4=sum(C3);
C5=C4';
C6=C2.*C5;
D=find(C6==0);
E=index1([D]);
r=index([E],:);
G=length(r);
for H=1:G
p=r(H,1);
q=r(H,2);
A(p,q)=255;
end
figure,imshow(A);
34
DETECTION OF COPY MOVE FORGERY IN DIGITAL IMAGES
CHAPTER-5 IMPLEMENTATION DETAILS
Z=t./l;
k=reshape(Z,1,y);
A7(v,:)=k;
end
[B,index1]=sortrows(A7);
% Identifying identical rows
B1=diff(B);
B2=B(1,:);
B3=[B2;B1];
B4=abs(B3);
B5=B(1:A8-1,:)-B(2:A8,:);
B6=B(A8,:);
B7=[B5;B6];
B8=abs(B7);
C=B4';
C1=sum(C);
C2=C1';
C3=B8';
C4=sum(C3);
C5=C4';
C6=C2.*C5;
D=find(C6==0);
E=index1([D]);
r=index([E],:);
G=length(r);
for H=1:G
p=r(H,1);
q=r(H,2);
A(p,q)=255;
endfigure,
imshow(A);
35
DETECTION OF COPY MOVE FORGERY IN DIGITAL IMAGES
CHAPTER-5 IMPLEMENTATION DETAILS
IMREAD : The imread function reads an image from any supported graphics image file
format, in any of the supported bit depths. Most image file formats use 8 bits to store
pixel values. When these are read into memory, MATLAB stores them as class uint8.
For file formats that support 16-bit data, PNG and TIFF, MATLAB stores the images as
class uint16.
RGB2GRAY : rgb2gray converts RGB images to grayscale by eliminating the hue and
saturation information while retaining the luminance.
IM2COL : Converts each sliding m-by-n block of A into a column of B, with no zero
padding. B has m*n rows and contains as many columns as there are m-by-n
neighborhoods of A. If the size of A is [mm nn], then the size of B is (m*n)-by-((mm-
m+1)*(nn-n+1)).
ABS : abs(X) returns an array Y such that each element of Y is the absolute value of
the corresponding element of X.
36
DETECTION OF COPY MOVE FORGERY IN DIGITAL IMAGES