基于核回归kernel regression方法的去模糊MATLAB源码


核回归方法(kernel regression)方法的去模糊MATLAB源码。来自著名的美国加州理工大学mdsp实验室,里面还包含一篇利用核回归方法去模糊方面的经典文献
资源截图
代码片段和文件信息
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% STEERING KERNEL DEBLURRING EXAMPLE 2 %%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% This simulation example demonstrates the kernel regression-based
% deblurring method with the steering kernel function and this generates
% the deblurred image of Fig.11(g) in the paper “Deblurring Using
% Locally-Adaptive Kernel regression.
%
% [Details]
% test image : cameraman
% PSF : 19 x 19 uniform
% BSNR : 25[dB]
%
% [History]
% Oct 12 2007 : coded and debugged by Hiro

% the mirroring width
mg = 15;

% read a test image
img = double(imread(‘cameraman.tif‘)); % Cameraman image

% create a PSF
PSFsupport = 19;
A = fspecial(‘ave‘ PSFsupport); % 19 x 19 uniform

% blur the test image
imgb = conv2verge(img A);

% add white Gaussian noise
BSNR = 25; % blurred signal to noise ration in [dB]
vn = var(imgb(:)) / 10^(BSNR/10); % compute the noise variance
randn(‘state‘ 0); % initialize the noise generator 
y = imgb + randn(size(imgb)) * sqrt(vn); % add white noise to the blurred image

% mirror the edges
y = EdgeMirror(y [mg mg]);
[N M] = size(y);

% initialization
% the pilot estimation by weiner filter
K = 0.001;
Af = fft2(A 512 512);
F = (abs(Af).^2 ./ (abs(Af).^2 + K)) ./ Af .* fft2(EdgeMirror(y(1+mg:end-mg 1+mg:end-mg) [128 128]));
y_init = ishift2(real(ifft2(F)) 9 9);
y_init = y_init(129-mg:end-128+mg 129-mg:end-128+mg);
y_init = double(round0_255(y_init));

fig_h = figure;
imshow(uint8(y_init(1+mg:end-mg 1+mg:end-mg))); colormap(gray); axis image;
pause(0.1);

% initialization by the second order classic kernel regression
title(‘Initializing by the second order classic kernel regression...‘);
pause(0.1);
Q = 2; % the regression order
hc = 0.8; % the global smoothing parameter
ktype = ‘ga‘; % the kernel type (‘ga‘ = Gaussian)
ksize = 7; % the kernel support size
[U Ux Uy Uxx Uxy Uyy] = ckr_a(y_init [0;0] 1 1 Q hc ktype ksize);
U = y_init;

% parameter
h = 1.0; % the global smoothing parameter for the likelihood term
hu = 1.5; % the global smoothing parameter for the regularization term
nu = 0.3; % the step size
IT = 6500; % the number of iterations
ksize = 7; % the kernel support size
ktype = ‘ga‘; % the kernel support size
reg_lambda = 0.75; % the regularization parameter
radius = (ksize - 1) / 2;

% parameters for the steering matrices
wsize = 11; % the analysis window size
lambda = 1; % the regularization parameter
alpha = 0.5; % the structure sensitivity
r = 1;

[x2 x1] = meshgrid(-radius:radius -radius:radius);
x1sq = x1.^2;
x2sq = x2.^2;
x1x2 = x1.* x2;

for it = 1 : IT
    % initialize error corrections
    ec_U = zeros(N M);
    ec_Ux = zeros(N M);
    ec_Uy = zeros(N M);
    
    % every 50 iterations we re-create the weight matrices
    if mod(it-1 50) == 0
        % estimate the orientation information from the estimated gradients
        % for the regularization term
       

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       8208  2007-10-12 02:39  KernelbasedDeblurringToolBox_ver1Examplescameraman_19x19ave_BSNR25.m

     文件       8209  2007-10-12 02:32  KernelbasedDeblurringToolBox_ver1Examplescameraman_19x19ave_BSNR40.m

     文件       8353  2008-01-02 03:03  KernelbasedDeblurringToolBox_ver1ExamplesChemicalPlant_11x11Ga175_BSNR30.m

     文件       7820  2007-10-12 02:28  KernelbasedDeblurringToolBox_ver1ExamplesLena_5x5Ga15_BSNR15.m

     文件   10614505  2009-11-27 11:14  KernelbasedDeblurringToolBox_ver1ExamplesRegularizedKernelDeblurring_Final.pdf

     文件      65240  1997-02-22 07:28  KernelbasedDeblurringToolBox_ver1imagescameraman.tif

     文件     151199  2005-08-17 17:05  KernelbasedDeblurringToolBox_ver1imageslena.png

    ..A.SH.     10240  2010-01-01 12:43  KernelbasedDeblurringToolBox_ver1imagesThumbs.db

     文件        390  2009-11-27 11:16  KernelbasedDeblurringToolBox_ver1instruction.txt

     文件       1095  2006-01-20 13:57  KernelbasedDeblurringToolBox_ver1SubFunctionseta_linear.m

     文件      10586  2006-02-07 14:21  KernelbasedDeblurringToolBox_ver1SubFunctionseta_quad2.m

     文件       7588  2006-02-07 14:17  KernelbasedDeblurringToolBox_ver1SubFunctionsckr_a.m

     文件        512  2006-02-14 14:52  KernelbasedDeblurringToolBox_ver1SubFunctionsconv2verge.m

     文件        230  2005-11-19 15:54  KernelbasedDeblurringToolBox_ver1SubFunctionsconvertmv.m

     文件        406  2005-12-17 15:45  KernelbasedDeblurringToolBox_ver1SubFunctionsEdgeMirror.m

     文件        303  2007-01-21 01:46  KernelbasedDeblurringToolBox_ver1SubFunctionsinv22.m

     文件        854  2007-01-21 01:46  KernelbasedDeblurringToolBox_ver1SubFunctionsinv33.m

     文件       1486  2006-10-23 13:44  KernelbasedDeblurringToolBox_ver1SubFunctionsishift2.m

     文件       4584  2006-09-04 15:40  KernelbasedDeblurringToolBox_ver1SubFunctionslpkernel.m

     文件        149  2005-10-09 13:29  KernelbasedDeblurringToolBox_ver1SubFunctions
ound0_255.m

     文件       1377  2007-10-11 17:27  KernelbasedDeblurringToolBox_ver1SubFunctionssteering_modified.m

     文件        273  2006-09-01 17:00  KernelbasedDeblurringToolBox_ver1SubFunctionsupsample2.m

     目录          0  2010-01-01 12:44  KernelbasedDeblurringToolBox_ver1Examples

     目录          0  2010-01-01 12:43  KernelbasedDeblurringToolBox_ver1images

     目录          0  2009-11-27 11:32  KernelbasedDeblurringToolBox_ver1SubFunctions

     目录          0  2009-11-27 11:32  KernelbasedDeblurringToolBox_ver1

----------- ---------  ---------- -----  ----

             10903607                    26


版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。

发表评论

评论列表(条)