RESTORE: image denoising or deconvolution by local regularization. RESTORE represents a local regularization framework in which no assumption is made on the noise nature (in particular, its variance may be unknown): relative weight of the regularization term is obtained by using the L-curve method [Hansen93]. The local implementation of the regularization implies that the noise may be non-stationary. In deconvolution problems, RESTORE needs the PSF information. Even though the formulation is local, in the current VistaRestoreTools version, the PSF is assumed to be spatially invariant. The restoration ability relies on the ability of the regularization functional to capture/extract/preserve the relevant features of the signal. A number of fixed and adaptive regularization functionals are provided in this function. (see J. Gutierrez et al. IEEE Tr.Im.Proc. 2006 for details). SYNTAX: im_r=restaura2(im_d,'regulariz_functional',PSF,lambdas); ***Output: * im_r..................= restored image ***Input: * im_d..................= degraded image * 'regulariz_functional'= string containing the selected regularization functional. The available possibilities include: * Classical regularization: - 'L2'.................: Second derivative regularization [Tikhonov79] - 'AR4', 'AR8', 'AR12'.: Wiener filtering with Auto-Regressive (AR) power spectrum estimation. The number in the string indicates the order of the AR model [Banham&Katsaggelos97] - 'CSF'................: Regularization using the inverse of the Contrast Sensitivity Function (CSF) [Hunt75]. * Regularization based on non-linear perception models - 'PER'................: Divisive normalization regularization functional [Gutierrez06]. - 'PERD'...............: Divisive normalization functional optimized for denoising * PSF....................= Point Spread Function as given by apply_degradation_2 * lambdas................= Vector with the possible values of the regularization parameter (relative weight of regularization vs deviation) The L-curve method is used to select one of these values for each block of the image. See details at: J. Gutierrez et al. Regularization Operators for Natural Images based on Non-linear Perception Models. IEEE Trans. Im. Proc. 15(1). 2006
0001 % 0002 % RESTORE: image denoising or deconvolution by local regularization. 0003 % 0004 % RESTORE represents a local regularization framework in which no 0005 % assumption is made on the noise nature (in particular, its variance 0006 % may be unknown): relative weight of the regularization term is 0007 % obtained by using the L-curve method [Hansen93]. The local 0008 % implementation of the regularization implies that the noise may 0009 % be non-stationary. 0010 % 0011 % In deconvolution problems, RESTORE needs the PSF information. 0012 % Even though the formulation is local, in the current VistaRestoreTools 0013 % version, the PSF is assumed to be spatially invariant. 0014 % 0015 % The restoration ability relies on the ability of the regularization 0016 % functional to capture/extract/preserve the relevant features of the 0017 % signal. A number of fixed and adaptive regularization functionals are 0018 % provided in this function. (see J. Gutierrez et al. IEEE Tr.Im.Proc. 2006 0019 % for details). 0020 % 0021 % SYNTAX: 0022 % 0023 % im_r=restaura2(im_d,'regulariz_functional',PSF,lambdas); 0024 % 0025 % ***Output: 0026 % 0027 % * im_r..................= restored image 0028 % 0029 % ***Input: 0030 % 0031 % * im_d..................= degraded image 0032 % 0033 % * 'regulariz_functional'= string containing the selected regularization 0034 % functional. The available possibilities include: 0035 % 0036 % * Classical regularization: 0037 % - 'L2'.................: Second derivative regularization [Tikhonov79] 0038 % - 'AR4', 'AR8', 'AR12'.: Wiener filtering with Auto-Regressive (AR) power 0039 % spectrum estimation. The number in the string 0040 % indicates the order of the AR model 0041 % [Banham&Katsaggelos97] 0042 % - 'CSF'................: Regularization using the inverse of the Contrast 0043 % Sensitivity Function (CSF) [Hunt75]. 0044 % 0045 % * Regularization based on non-linear perception models 0046 % - 'PER'................: Divisive normalization regularization functional 0047 % [Gutierrez06]. 0048 % - 'PERD'...............: Divisive normalization functional 0049 % optimized for denoising 0050 % 0051 % * PSF....................= Point Spread Function as given by apply_degradation_2 0052 % 0053 % * lambdas................= Vector with the possible values of the regularization 0054 % parameter (relative weight of regularization vs deviation) 0055 % The L-curve method is used to select one of 0056 % these values for each block of the image. 0057 % 0058 % 0059 % See details at: J. Gutierrez et al. Regularization Operators for 0060 % Natural Images based on Non-linear Perception Models. 0061 % IEEE Trans. Im. Proc. 15(1). 2006 0062 % 0063 function imr=restaura2(im,method,PSF,lambdas,varargin) 0064 0065 warning('off','MATLAB:dispatcher:InexactMatch') 0066 a=size(im); 0067 bordefil=(ceil(a(1)/16)*16-a(1)); 0068 bordecol=(ceil(a(2)/16)*16-a(2)); 0069 im_a = [im repmat(im(:,end),1,bordecol); repmat(im(end,:),bordefil,1) repmat(im(end,end),bordefil,bordecol)]; 0070 u=0; 0071 0072 N=16; 0073 0074 M=32; 0075 0076 if strcmp(method,'AR4')==1 0077 [imr_a] = regu_modelo_ar4(im_a,PSF,lambdas,N,M,2,0); 0078 elseif strcmp(method,'AR8')==1 0079 [imr_a] = regu_model_ar8(im_a,PSF,lambdas,N,M,2,0); 0080 elseif strcmp(method,'AR12')==1 0081 [imr_a] = regu_modelo_ar12(im_a,PSF,lambdas,N,M,2,0); 0082 elseif strcmp(method,'L2')==1 0083 Operador=freqz2(filt2dsegder,M,M); 0084 [imr_a] = regu_operator(im_a,PSF,lambdas,N,M,Operador,2,0); 0085 elseif strcmp(method,'CSF')==1 0086 load CSF_Operator; 0087 [imr_a] = regu_operator(im_a,PSF,lambdas,N,M,CSF_Operator,2,0); 0088 elseif strcmp(method,'PER1')==1 0089 corteResp = 800; 0090 0091 load response_parameters; 0092 0093 imr_a=regu_perceptual(im_a,PSF,lambdas,N,M,H,k1,k2,corteResp,2,0); 0094 elseif strcmp(method,'PER2')==1 0095 corteResp = 1000; 0096 0097 load response_parameters; 0098 0099 imr_a=regu_perceptual(im_a,PSF,lambdas,N,M,H,k1,k2,corteResp,2,0); 0100 elseif strcmp(method,'PER3')==1 0101 corteResp = 1600; 0102 0103 load response_parameters; 0104 0105 imr_a=regu_perceptual(im_a,PSF,lambdas,N,M,H,k1,k2,corteResp,2,0); 0106 else 0107 ['The requested method (' method ') is not implemented'] 0108 u=1; 0109 end 0110 0111 if u==1 0112 imr=0; 0113 else 0114 imr=imr_a(1:a(1),1:a(2)); 0115 end