demo_restoration

PURPOSE ^

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 
0002 fc = 45;
0003 
0004 clc;
0005 echo off;
0006 
0007 if (isempty(who('Id')))
0008    disp('To run this script there should be an image named Id in the workspace.');
0009    disp('Id should contain the degraded image.');
0010    return;
0011 end
0012 
0013 Val_min = 0.001;
0014 
0015 lim_frec = [0 3];
0016 
0017 vari = 400;
0018 
0019 [W,PSF,H,noise,Blurred]=degrade2(rand(256),fc,Val_min,lim_frec,vari);
0020 
0021 Nlambdas = 60;
0022 
0023 lambdas = logspace(-4,3,Nlambdas);
0024 
0025 disp(['Restoring image using L2 (' num2str(Nlambdas) ' values of lambda)']);
0026 
0027 imrl2=restaura2(Id,'L2',PSF,lambdas);
0028 
0029 figure;
0030 imshow(imrl2/255);
0031 title('Restored (L2)');
0032 
0033 disp('Press any key...');
0034 pause;
0035 
0036 disp(['Restoring image using CSF (' num2str(Nlambdas) ' values of lambda)']);
0037 
0038 imrcsf=restaura2(Id,'CSF',PSF,lambdas);
0039 
0040 figure;
0041 imshow(imrcsf/255);
0042 title('Restored (CSF)');
0043 
0044 disp('Press any key...');
0045 pause;
0046 
0047 disp(['Restoring image using AR4 (' num2str(Nlambdas) ' values of lambda)']);
0048 
0049 imrar4=restaura2(Id,'AR4',PSF,lambdas);
0050 
0051 figure;
0052 imshow(imrar4/255);
0053 title('Restored (AR4)');
0054 
0055 disp('Press any key...');
0056 pause;
0057 
0058 disp(['Restoring image using AR8 (' num2str(Nlambdas) ' values of lambda)']);
0059 
0060 imrar8=restaura2(Id,'AR8',PSF,lambdas);
0061 
0062 figure;
0063 imshow(imrar8/255);
0064 title('Restored (AR8)');
0065 
0066 disp('Press any key...');
0067 pause;
0068 
0069 disp(['Restoring image using AR12 (' num2str(Nlambdas) ' values of lambda)']);
0070 
0071 imrar12=restaura2(Id,'AR12',PSF,lambdas);
0072 
0073 figure;
0074 imshow(imrar12/255);
0075 title('Restored (AR12)');
0076 
0077 disp('Press any key...');
0078 pause;
0079 
0080 disp(['Restoring image using PERCEPTUAL (' num2str(Nlambdas) ' values of lambda)']);
0081 
0082 imrper=restaura2(Id,'PER',PSF,lambdas);
0083 
0084 figure;
0085 imshow(imrper/255);
0086 title('Restored (PERCEPTUAL)');
0087 
0088

Generated on Fri 07-Mar-2014 13:28:33 by m2html © 2005