资源简介

该程序很规范的应用核回归 Kernel regression 理论 以及应用了自适应高斯函数做核,达到图像处理的去噪,去模糊,超分等处理,本人项目用应用到的,感觉其他人也会用,因此分享,这是Takeda在07年发表的文章《Kernel Regression for Image Processing and Reconstruction》(IEEE TRANSACTIONS ON IMAGE PROCESSING, VOL. 16, NO. 2, FEBRUARY 2007)中提供的代码,对于学习核回归理论的朋友很有帮助!

资源截图

代码片段和文件信息

% A film grain removal example by iterative steering kernel regression
%
% written by hiro June 17 2007

% load image
img = double(imread(‘JFKreg.jpg‘));
[NM] = size(img(::1));

% convert the image into the YCrCb channels
[Y Cr Cb] = RGB2YCC(img);

% the input image
y = zeros(N M 3);
y(::1) = Y;
y(::2) = Cr;
y(::3) = Cb;

% pilot estimation by second order classic kernel regression
% on the luminance channel
h = 0.5;    % the global smoothing parameter
r = 1;      % the upscaling factor
ksize = 5;  % the kernel size
[zc zx1c zx2c] = ckr2_regular(y(::1) h r ksize);

% iteartive steering kernel regression (second order)
IT = 5;     % the total number of iterations
wsize = 11;  % the size of the local orientation analysis window
lambda = 1;  % the regularization for the elongation parameter
alpha = 0.5; % the structure sensitive parameter
h = 2.3;     % the global smoothing parameter
ksize = 11;  % the kernel size
z = zeros(N M 3 IT+1);
zx1 = zeros(N M 3 IT+1);
zx2 = zeros(N M 3 IT+1);
z(:::1) = y;
zx1(::1) = zx1c;
zx2(::1) = zx2c;

for i = 2 : IT+1
    % compute steering matrix from the Y channel
    C = steering(zx1(::i-1) zx2(::i-1) ones(size(img)) wsize lambda alpha);
    % steering kernel regression
    % Y channel
    [zs zx1s zx2s] = skr2_regular(z(::1i-1) h C r ksize);
    z(::1i) = zs;
    zx1(::i) = zx1s;
    zx2(::i) = zx2s;
    % Cr channel
    [zs zx1s zx2s] = skr2_regular(z(::2i-1) h C r ksize);
    z(::2i) = zs;
    % Cb channel
    [zs zx1s zx2s] = skr2_regular(z(::3i-1) h C r ksize);
    z(::3i) = zs;
end

% display images
zRGB = YCC2RGB(z(::14) z(::24) z(::34));
figure; imagesc(uint8(img)); colormap(gray); axis image;
title(‘The original image‘);
figure; imagesc(uint8(zRGB)); colormap(gray); axis image;
title(‘The denoised image by iterative steering kernel regression 3 iterations‘);
gray_reverse = gray;
gray_reverse = gray_reverse(64:-1:1 :);
figure; imagesc(abs(z(::11) - z(::14))); colormap(gray_reverse); axis image; colorbar;
title(‘The absolute residual image in the luminance channel‘);


 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2008-04-14 18:06  KernelRegressionbasedImageProcessingToolBox_ver1-2beta\Examples\
     文件        2213  2007-06-22 23:48  KernelRegressionbasedImageProcessingToolBox_ver1-2beta\Examples\JFK_denoise.m
     文件        1852  2007-11-07 13:31  KernelRegressionbasedImageProcessingToolBox_ver1-2beta\Examples\Lena_denoise.m
     文件        1536  2007-11-07 14:01  KernelRegressionbasedImageProcessingToolBox_ver1-2beta\Examples\Lena_irregular.m
     文件        2806  2007-11-07 14:04  KernelRegressionbasedImageProcessingToolBox_ver1-2beta\Examples\Lena_saltpepper.m
     文件        1114  2007-11-07 13:28  KernelRegressionbasedImageProcessingToolBox_ver1-2beta\Examples\Lena_upscale.m
     文件        1856  2007-11-07 14:08  KernelRegressionbasedImageProcessingToolBox_ver1-2beta\Examples\Pepper_deblock.m
     目录           0  2008-04-14 18:06  KernelRegressionbasedImageProcessingToolBox_ver1-2beta\KernelRegression\
     文件        2140  2008-04-14 18:10  KernelRegressionbasedImageProcessingToolBox_ver1-2beta\KernelRegression\ckr2_irregular.m
     文件        2459  2008-04-14 18:12  KernelRegressionbasedImageProcessingToolBox_ver1-2beta\KernelRegression\ckr2_regular.m
     文件        2405  2008-04-14 18:13  KernelRegressionbasedImageProcessingToolBox_ver1-2beta\KernelRegression\ckr2all_regular.m
     文件        2643  2007-07-01 14:33  KernelRegressionbasedImageProcessingToolBox_ver1-2beta\KernelRegression\ckr2L1_regular.m
     文件        2610  2008-04-14 18:14  KernelRegressionbasedImageProcessingToolBox_ver1-2beta\KernelRegression\skr0_irregular.m
     文件        2753  2008-04-14 18:14  KernelRegressionbasedImageProcessingToolBox_ver1-2beta\KernelRegression\skr0_regular.m
     文件        3064  2008-04-14 18:14  KernelRegressionbasedImageProcessingToolBox_ver1-2beta\KernelRegression\skr2_irregular.m
     文件        3326  2008-04-14 18:15  KernelRegressionbasedImageProcessingToolBox_ver1-2beta\KernelRegression\skr2_regular.m
     文件        3572  2007-07-01 14:59  KernelRegressionbasedImageProcessingToolBox_ver1-2beta\KernelRegression\skr2L1_regular.m
     文件        1381  2008-04-14 18:09  KernelRegressionbasedImageProcessingToolBox_ver1-2beta\KernelRegression\steering.m
     目录           0  2008-04-14 18:06  KernelRegressionbasedImageProcessingToolBox_ver1-2beta\SupportFunctions\
     文件         246  2005-09-16 13:53  KernelRegressionbasedImageProcessingToolBox_ver1-2beta\SupportFunctions\downsample2.m
     文件         406  2005-12-17 14:45  KernelRegressionbasedImageProcessingToolBox_ver1-2beta\SupportFunctions\EdgeMirror.m
     文件          57  2007-11-07 13:28  KernelRegressionbasedImageProcessingToolBox_ver1-2beta\SupportFunctions\mymse.m
     文件         475  2005-11-21 12:05  KernelRegressionbasedImageProcessingToolBox_ver1-2beta\SupportFunctions\RGB2YCC.m
     文件         149  2005-10-09 12:29  KernelRegressionbasedImageProcessingToolBox_ver1-2beta\SupportFunctions\round0_255.m
     文件         273  2006-09-01 16:00  KernelRegressionbasedImageProcessingToolBox_ver1-2beta\SupportFunctions\upsample2.m
     文件         340  2005-12-06 21:56  KernelRegressionbasedImageProcessingToolBox_ver1-2beta\SupportFunctions\YCC2RGB.m
     目录           0  2008-04-14 18:06  KernelRegressionbasedImageProcessingToolBox_ver1-2beta\TestImages\
     文件       41431  2005-07-19 14:11  KernelRegressionbasedImageProcessingToolBox_ver1-2beta\TestImages\JFKreg.jpg
     文件      151199  2005-08-17 16:05  KernelRegressionbasedImageProcessingToolBox_ver1-2beta\TestImages\lena.png
     文件       66102  2005-10-22 11:38  KernelRegressionbasedImageProcessingToolBox_ver1-2beta\TestImages\pepper.bmp
     文件        2885  2007-11-07 14:08  KernelRegressionbasedImageProcessingToolBox_ver1-2beta\TestImages\pepper.jpg
............此处省略0个文件信息

评论

共有 条评论