function rsmp_core(file) % ******************************************************** % The basic part of the resampling detection method proposed in: % B. Mahdian and S. Saic. Blind authentication using periodic properties of interpolation. % IEEE Transactions on Information Forensics and Security, 3(3):529–538, September 2008. % Example: rsmp_core('images/lena.tiff'); % © Babak Mahdian, January 2007 % This source code is provided only for non-commercial and research % pruposes. % ******************************************************** order=2; radon_step=1; radon_max=179; if nargin==0 error('Error! Missing image.'); end; im=double(imread(file)); if size(im,3)==3 warning('Color image. In this experimental version only green channel is investigated.'); im=im(:,:,2); end; %%%%%%%%%%%%%%%% %im=imresize(im,.9,'bicubic',0); %im=imrotate(im,-15,'bilinear');im=crop_my_image(im,p1,p2); %%%%%%%%%%%%%%%% figure(1); clf; subplot(3,1,1); imagesc(im); colormap('gray') axis image theta =0:radon_step:radon_max; d=diff(im,order,1); [r,xp] = radon(abs(d),theta); r=diff(r,1); subplot(3,1,2); ft=abs(fft(xcov(r(:,1)))); for i=1:size(r,2) ft=max(ft,abs(fft(xcov(r(:,i))))); end; ft=ft/norm(ft); plot(ft(1:end,:)); theta =0:radon_step:radon_max; d=diff(im,order,2); [r,xp] = radon(abs(d),theta); r=diff(r,1); subplot(3,1,3); ft=abs(fft(xcov(r(:,1)))); for i=1:size(r,2) ft=max(ft,abs(fft(xcov(r(:,i))))); end; ft=ft/norm(ft); plot(ft(1:end,:)); return;