-
大小: 10.17MB文件類型: .rar金幣: 2下載: 0 次發布日期: 2023-11-09
- 語言: Matlab
- 標簽: deblur??kernel??regression??super??
資源簡介
核回歸方法(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??Kernelba
?????文件???????8209??2007-10-12?02:32??Kernelba
?????文件???????8353??2008-01-02?03:03??Kernelba
?????文件???????7820??2007-10-12?02:28??Kernelba
?????文件???10614505??2009-11-27?11:14??Kernelba
?????文件??????65240??1997-02-22?07:28??Kernelba
?????文件?????151199??2005-08-17?17:05??Kernelba
????..A.SH.?????10240??2010-01-01?12:43??Kernelba
?????文件????????390??2009-11-27?11:16??Kernelba
?????文件???????1095??2006-01-20?13:57??Kernelba
?????文件??????10586??2006-02-07?14:21??Kernelba
?????文件???????7588??2006-02-07?14:17??Kernelba
?????文件????????512??2006-02-14?14:52??Kernelba
?????文件????????230??2005-11-19?15:54??Kernelba
?????文件????????406??2005-12-17?15:45??Kernelba
?????文件????????303??2007-01-21?01:46??Kernelba
?????文件????????854??2007-01-21?01:46??Kernelba
?????文件???????1486??2006-10-23?13:44??Kernelba
?????文件???????4584??2006-09-04?15:40??Kernelba
?????文件????????149??2005-10-09?13:29??Kernelba
?????文件???????1377??2007-10-11?17:27??Kernelba
?????文件????????273??2006-09-01?17:00??Kernelba
?????目錄??????????0??2010-01-01?12:44??Kernelba
?????目錄??????????0??2010-01-01?12:43??Kernelba
?????目錄??????????0??2009-11-27?11:32??Kernelba
?????目錄??????????0??2009-11-27?11:32??Kernelba
-----------?---------??----------?-----??----
?????????????10903607????????????????????26
- 上一篇:音樂檢索系統MATLAB程序.zip
- 下一篇:ECO配置好的MATLAB版本
評論
共有 條評論