⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 synthesize.m

📁 3D shape reconstruction matlab code. It used shape from defocus technique with diffusion. You can re
💻 M
字号:
function [I,J] = synthesize(radiance,Sigma2,...
    modelnoise,sensornoise,Nit)
% The following code generates synthetic blurred images 
% via diffusion
%
% 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.

% set image size
if nargin<3
    modelnoise = 0;
end
if nargin<4
    sensornoise = 0;
end
if nargin<5
    Nit = 5;
end
[m,n,three] = size(radiance);

di = .1;
I = zeros(m,n,three);
% search for max number of iterations (Nit)
for k = 1:three
    Sigma2 = Sigma2.*(Sigma2>0);
    DiffCoeff(:,:,k) = Sigma2;
    if (Nit<ceil(max(Sigma2(:))/di))
        Nit = ceil(max(Sigma2(:))/di);
    end
end
if Nit>30
    errmsg = sprintf(...
        ['Current simulation requires %d iterations!\n' ...
        'To proceed change max number of iterations in' ...
        ' function synthesize.m'],Nit);
    error(errmsg);
end
% simulate diffusion
for k = 1:three
    [I(:,:,k),J(:,:,:,k)] = diffusion(radiance(:,:,k)+...
        modelnoise*randn(m,n),DiffCoeff(:,:,k),Nit,...
        sensornoise*randn(m,n));
end
return

⌨️ 快捷键说明

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