diffusion.m

来自「3D shape reconstruction matlab code. It 」· M 代码 · 共 28 行

M
28
字号
function  [I,J] = diffusion(radiance,diffcoeff,Nit,noise)
% Simulate the diffusion equation for Nit steps
%
% Copyright 2006 Paolo Favaro (p.favaro@hw.ac.uk)
% 
% School of Engineering and Physical Sciences
% Heriot-Watt University, Edinburgh, UK
% 
% Last revision: August 2006
%
% This program can be used only for research purposes.
% This program is distributed WITHOUT ANY WARRANTY; 
% without even the implied warranty of MERCHANTABILITY 
% or FITNESS FOR A PARTICULAR PURPOSE.

J = radiance;
I = radiance;
for i=1:Nit
    % diffuse (one step)
    if mod(i,2)==0
        div = divergence(J(:,:,i),diffcoeff/Nit);
    else 
        div = divergenceR(J(:,:,i),diffcoeff/Nit);
    end
    J(:,:,i+1) = J(:,:,i)+div;
end
I = J(:,:,Nit+1)+noise;
return

⌨️ 快捷键说明

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