Page 183 - Algorithm Collections for Digital Signal Processing Applications using MATLAB
P. 183

172                                                        Chapter 4

           0’s,  decide that the image is  photographic image. Otherwise the image is
           classified as photo realistic image.



           8.2      M-program for Detecting Photo Realistic Images
                    Using ICA Basis

              ___________________________________________________________

              photorealisticdetgv.m

              k=1;
              for  i=1:1:20
                  s=strcat('C:\Documents and Settings\user1\Desktop\Photorealistic\',num2str(i),'.jpg');
              for  j=1:1:50
                  temp=imread(s);
                  temp=rgb2gray(temp);
                  temp=temp(101:1:200,101:1:200);
                  r1=round(rand*(size(temp,1)-8))+1;
                  r2=round(rand*(size(temp,2)-8))+1;
                  temp=reshape(temp(r1:1:r1+7,r2:1:r2+7),1,64);;
                  temp=double(temp);
                  A{k}=lpc(temp,16);
                  k=k+1;
              end
              end


              temp=cell2mat(A');
              temp=temp(:,2:1:17);
              I=fastica(temp);
              save  I   I

              k=1 ;
              for i=1:1:20
                  s=strcat('C:\Documents and Settings\user1\Desktop\Photorealistic\',num2str(i),'.jpg');
              for j=1:1:100
                  temp=imread(s);
                  temp=rgb2gray(temp);
                  temp=temp(101:1:200,101:1:200);
                  r1=round(rand*(size(temp,1)-8))+1;
                  r2=round(rand*(size(temp,2)-8))+1;
   178   179   180   181   182   183   184   185   186   187   188