0001 0002 figure; 0003 0004 clc; 0005 echo off; 0006 0007 disp('Loading image'); 0008 0009 load barbara256; 0010 imshow(Im/255); 0011 title('Original image'); 0012 0013 disp('Degrading image (almost denoising)'); 0014 0015 fc = 24; 0016 Val_min = 0.001; 0017 0018 lim_frec = [0 3]; 0019 0020 vari = 400; 0021 0022 [Id,PSF,H,noise,Blurred]=degrade2(Im,fc,Val_min,lim_frec,vari); 0023 figure; 0024 imshow(Id/255); 0025 title(['Degraded image (f_c = ' num2str(fc) ',\sigma^2 = ' num2str(vari) ')']); 0026 0027 disp('Press any key...'); 0028 pause; 0029 0030 disp('SENSITIVITY TO LAMBDA'); 0031 0032 Nlambdas = 1; 0033 lambdas = 1; 0034 0035 disp(['Restoring image using PERCEPTUAL (' num2str(Nlambdas) ' values of lambda)']); 0036 0037 imrper=restaura2(Id,'PER',PSF,lambdas); 0038 0039 figure; 0040 imshow(imrper/255); 0041 title(['Perceptual, \lambda=' num2str(lambdas)]); 0042 0043 Nlambdas = 1; 0044 lambdas = 2; 0045 0046 disp(['Restoring image using PERCEPTUAL (' num2str(Nlambdas) ' values of lambda)']); 0047 0048 imrper=restaura2(Id,'PER',PSF,lambdas); 0049 0050 figure; 0051 imshow(imrper/255); 0052 title(['Perceptual, \lambda=' num2str(lambdas)]); 0053 0054 Nlambdas = 1; 0055 lambdas = 4; 0056 0057 disp(['Restoring image using PERCEPTUAL (' num2str(Nlambdas) ' values of lambda)']); 0058 0059 imrper=restaura2(Id,'PER',PSF,lambdas); 0060 0061 figure; 0062 imshow(imrper/255); 0063 title(['Perceptual, \lambda=' num2str(lambdas)]); 0064 0065 Nlambdas = 1; 0066 lambdas = 6; 0067 0068 disp(['Restoring image using PERCEPTUAL (' num2str(Nlambdas) ' values of lambda)']); 0069 0070 imrper=restaura2(Id,'PER',PSF,lambdas); 0071 0072 figure; 0073 imshow(imrper/255); 0074 title(['Perceptual, \lambda=' num2str(lambdas)]); 0075 0076 Nlambdas = 1; 0077 lambdas = 10; 0078 0079 disp(['Restoring image using PERCEPTUAL (' num2str(Nlambdas) ' values of lambda)']); 0080 0081 imrper=restaura2(Id,'PER',PSF,lambdas); 0082 0083 figure; 0084 imshow(imrper/255); 0085 title(['Perceptual, \lambda=' num2str(lambdas)]); 0086 0087 Nlambdas = 1; 0088 lambdas = 1; 0089 0090 disp(['Restoring image using AR12 (' num2str(Nlambdas) ' values of lambda)']); 0091 0092 imrar12=restaura2(Id,'AR12',PSF,lambdas); 0093 0094 figure; 0095 imshow(imrar12/255); 0096 title(['AR12, \lambda=' num2str(lambdas)]); 0097 0098 Nlambdas = 1; 0099 lambdas = 2; 0100 0101 disp(['Restoring image using AR12 (' num2str(Nlambdas) ' values of lambda)']); 0102 0103 imrar12=restaura2(Id,'AR12',PSF,lambdas); 0104 0105 figure; 0106 imshow(imrar12/255); 0107 title(['AR12, \lambda=' num2str(lambdas)]); 0108 0109 Nlambdas = 1; 0110 lambdas = 4; 0111 0112 disp(['Restoring image using AR12 (' num2str(Nlambdas) ' values of lambda)']); 0113 0114 imrar12=restaura2(Id,'AR12',PSF,lambdas); 0115 0116 figure; 0117 imshow(imrar12/255); 0118 title(['AR12, \lambda=' num2str(lambdas)]); 0119 0120 Nlambdas = 1; 0121 lambdas = 6; 0122 0123 disp(['Restoring image using AR12 (' num2str(Nlambdas) ' values of lambda)']); 0124 0125 imrar8=restaura2(Id,'AR12',PSF,lambdas); 0126 0127 figure; 0128 imshow(imrar12/255); 0129 title(['AR12, \lambda=' num2str(lambdas)]); 0130 0131 Nlambdas = 1; 0132 lambdas = 10; 0133 0134 disp(['Restoring image using AR12 (' num2str(Nlambdas) ' values of lambda)']); 0135 0136 imrar8=restaura2(Id,'AR12',PSF,lambdas); 0137 0138 figure; 0139 imshow(imrar12/255); 0140 title(['AR12, \lambda=' num2str(lambdas)]); 0141