KeCoDe_restoration: image denoising or deconvolution by local regularization. KeCoDe_restoration 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, KeCoDe_restoration needs the PSF information. Even though the formulation is local, in the current KeCoDe 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 = KeCoDe_restoration(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]. * PSF....................= Point Spread Function as given by KeCoDe_degradation * 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 % KeCoDe_restoration: image denoising or deconvolution by local regularization. 0003 % 0004 % KeCoDe_restoration 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, KeCoDe_restoration needs the PSF information. 0012 % Even though the formulation is local, in the current KeCoDe version, 0013 % 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 = KeCoDe_restoration(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 % 0049 % * PSF....................= Point Spread Function as given by KeCoDe_degradation 0050 % 0051 % * lambdas................= Vector with the possible values of the regularization 0052 % parameter (relative weight of regularization vs deviation) 0053 % The L-curve method is used to select one of 0054 % these values for each block of the image. 0055 % 0056 % 0057 % See details at: J. Gutierrez et al. Regularization Operators for 0058 % Natural Images based on Non-linear Perception Models. 0059 % IEEE Trans. Im. Proc. 15(1). 2006 0060 % 0061 0062 function imr = KeCoDe_restoration(im,method,PSF,lambdas,varargin) 0063 0064 warning('off','MATLAB:dispatcher:InexactMatch') 0065 a=size(im); 0066 bordefil=(ceil(a(1)/16)*16-a(1)); 0067 bordecol=(ceil(a(2)/16)*16-a(2)); 0068 im_a = [im repmat(im(:,end),1,bordecol); repmat(im(end,:),bordefil,1) repmat(im(end,end),bordefil,bordecol)]; 0069 u=0; 0070 0071 N=16; 0072 0073 M=32; 0074 0075 if strcmp(method,'AR4')==1 0076 [imr_a] = regu_modelo_ar4(im_a,PSF,lambdas,N,M,2,0); 0077 elseif strcmp(method,'AR8')==1 0078 [imr_a] = regu_model_ar8(im_a,PSF,lambdas,N,M,2,0); 0079 elseif strcmp(method,'AR12')==1 0080 [imr_a] = regu_modelo_ar12(im_a,PSF,lambdas,N,M,2,0); 0081 elseif strcmp(method,'L2')==1 0082 Operador=freqz2(filt2dsegder,M,M); 0083 [imr_a] = regu_operator(im_a,PSF,lambdas,N,M,Operador,2,0); 0084 elseif strcmp(method,'CSF')==1 0085 load csf_operator; 0086 [imr_a] = regu_operator(im_a,PSF,lambdas,N,M,CSF_Operator,2,0); 0087 elseif strcmp(method,'PER')==1 0088 corteResp = 1600; 0089 0090 load response_parameters; 0091 0092 imr_a=regu_perceptual(im_a,PSF,lambdas,N,M,H,k1,k2,corteResp,2,0); 0093 0094 else 0095 ['The requested method (' method ') is not implemented'] 0096 u=1; 0097 end 0098 0099 if u==1 0100 imr=0; 0101 else 0102 imr=imr_a(1:a(1),1:a(2)); 0103 end