91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

資源簡介

基于論文“Real-Time Video Abstraction”的圖像抽象化matlab代碼,文中的濾波算法是雙邊濾波,附帶圖像,可以直接運行

資源截圖

代碼片段和文件信息

%?BFILTER2?Two?dimensional?bilateral?filtering.
%????This?function?implements?2-D?bilateral?filtering?using
%????the?method?outlined?in:
%
%???????C.?Tomasi?and?R.?Manduchi.?Bilateral?Filtering?for?
%???????Gray?and?Color?Images.?In?Proceedings?of?the?IEEE?
%???????International?Conference?on?Computer?Vision?1998.?
%
%????B?=?bfilter2(AWSIGMA)?performs?2-D?bilateral?filtering
%????for?the?grayscale?or?color?image?A.?A?should?be?a?double
%????precision?matrix?of?size?NxMx1?or?NxMx3?(i.e.?grayscale
%????or?color?images?respectively)?with?normalized?values?in
%????the?closed?interval?[01].?The?half-size?of?the?Gaussian
%????bilateral?filter?window?is?defined?by?W.?The?standard
%????deviations?of?the?bilateral?filter?are?given?by?SIGMA
%????where?the?spatial-domain?standard?deviation?is?given?by
%????SIGMA(1)?and?the?intensity-domain?standard?deviation?is
%????given?by?SIGMA(2).
%
%?Douglas?R.?Lanman?Brown?University?September?2006.
%?dlanman@brown.edu?http://mesh.brown.edu/dlanman


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%?Pre-process?input?and?select?appropriate?filter.
function?B?=?bfilter2(Awsigma)

%?Verify?that?the?input?image?exists?and?is?valid.
if?~exist(‘A‘‘var‘)?||?isempty(A)
???error(‘Input?image?A?is?undefined?or?invalid.‘);
end
if?~isfloat(A)?||?~sum([13]?==?size(A3))?||?...
??????min(A(:))??1
???error([‘Input?image?A?must?be?a?double?precision?‘...
??????????‘matrix?of?size?NxMx1?or?NxMx3?on?the?closed?‘...
??????????‘interval?[01].‘]);??????
end

%?Verify?bilateral?filter?window?size.
if?~exist(‘w‘‘var‘)?||?isempty(w)?||?...
??????numel(w)?~=?1?||?w????w?=?5;
end
w?=?ceil(w);

%?Verify?bilateral?filter?standard?deviations.
if?~exist(‘sigma‘‘var‘)?||?isempty(sigma)?||?...
??????numel(sigma)?~=?2?||?sigma(1)?<=?0?||?sigma(2)?<=?0
???sigma?=?[3?0.1];
end

%?Apply?either?grayscale?or?color?bilateral?filtering.
if?size(A3)?==?1
???B?=?bfltGray(Awsigma(1)sigma(2));
else
???B?=?bfltColor(Awsigma(1)sigma(2));
end


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%?Implements?bilateral?filtering?for?grayscale?images.
function?B?=?bfltGray(Awsigma_dsigma_r)

%?Pre-compute?Gaussian?distance?weights.
[XY]?=?meshgrid(-w:w-w:w);
G?=?exp(-(X.^2+Y.^2)/(2*sigma_d^2));

%?Create?waitbar.
h?=?waitbar(0‘Applying?bilateral?filter...‘);
set(h‘Name‘‘Bilateral?Filter?Progress‘);

%?Apply?bilateral?filter.
dim?=?size(A);
B?=?zeros(dim);
for?i?=?1:dim(1)
???for?j?=?1:dim(2)
??????
?????????%?Extract?local?region.
?????????iMin?=?max(i-w1);
?????????iMax?=?min(i+wdim(1));
?????????jMin?=?max(j-w1);
?????????jMax?=?min(j+wdim(2));
?????????I?=?A(iMin:iMaxjMin:jMax);
??????
?????????%?Compute?Gaussian?intensity?weights.
?????????H?=?exp(-(I-A(ij)).^2/(2*sigma_r^2));
??????
?????????%?Calculate?bilateral?filter?response.
?????????F?=?H.*G((iMin:iMax)-i+w+1(jMin:jMax)-j+w+1);
??

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2016-04-10?11:16??Image?Abstract?Matlab?Code\
?????文件??????673263??2016-04-08?20:38??Image?Abstract?Matlab?Code\6.png
?????文件?????1740996??2016-04-10?11:10??Image?Abstract?Matlab?Code\7.png
?????文件????????4840??2016-04-10?11:06??Image?Abstract?Matlab?Code\bfilter2.m
?????文件????????2751??2016-04-10?11:07??Image?Abstract?Matlab?Code\cartoon.m
?????文件???????14017??2016-04-10?11:08??Image?Abstract?Matlab?Code\colorspace.m
?????文件????????2078??2016-04-10?11:16??Image?Abstract?Matlab?Code\demo_abstract.m
?????文件??????324269??2015-12-26?16:10??Image?Abstract?Matlab?Code\woman.png

評論

共有 條評論