nearneighbors.m

来自「Nearest neighbors is a semi deconvolutio」· M 代码 · 共 19 行

M
19
字号
function k = nearneigh(filename1, filename2, filename3, weight, sigma)

%      Nearest is a function that given three images as input, it will blur 
%      a copy of two of them using a gaussian function with parameters
%      determined by the user - radius and sigma - and then subtract both 
%      of them to the original (first) image, by a weighting variable,
%      composing a shapened image.
%
%      NEAREST('filename.xxx', 'filename+1.xxx', 'filename-1.xxx', weight, 
%               radius, sigma) 
%      


fname_temp = imresize(imread(filename1), 0.35);
fname = 255 - fname_temp; 
temp1 = blur(filename2, sigma); 
temp2 = blur(filename3, sigma); 
z1 = 255 - (fname - weight*temp1);
k = z1 - weight*temp2;

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?