% test
s = 1;

psnr_temp=[];
psnr_temp2 = [];
image = 'real';
ridkost = 5;
rozmer = 64;
original_picture = 'lena.jpg';
baze ='DWT';
wavelet ='haar';
hloubka_decom =3;
input_snr = 5;


tic
for i=1:s
    
  [signal_in, signal_noised, signal_out,  psnr, psnr_sr] = signal_denoising_2D_impl(image, ridkost, rozmer,original_picture,baze, wavelet, hloubka_decom, input_snr);
   psnr_temp= [psnr_temp; psnr];
   psnr_temp2= [psnr_temp2; psnr_sr];

   figure
   imagesc(reshape(signal_in,M,N));
colormap(gray)
colorbar
axis image
title('Originalni obraz');

figure
imagesc(reshape(signal_in,M,N)-signal_noised);
colormap(gray)
colorbar
axis image
title('Sum');
 
figure
imagesc(signal_noised);
colormap(gray)
axis image
title('Zasumeny obraz');
 
 figure
 imagesc(reshape(signal_out,M,N));
  colormap(gray)
  axis image
 title('Rekonstrukce');
 
  
 figure
 imagesc(reshape(signal_in-signal_out,M,N));
 colorbar
 colormap(gray)
 title('Rezidua');
 
  
 figure
  imagesc(signal_noised-reshape(signal_out,M,N));
  colorbar
  colormap(gray)
  title('R');
  title('Odstraneny sum');
    
    
    
   
end
toc;
disp('PSNR=');
disp(mean(psnr_temp));
disp('PSNR_sr=');
disp(mean(psnr_temp2));