function [J,T]=diffusion_timestep(I,sigma,iter,g,dt,h) %% Total Variation denoising. %% Example: J=chambolle1(I,iter,lam,I0) %% Input: I - image (double array gray level 1-256), %% sigma - standard deviation of image noise [sigma=0.1] %% iter - max. number of iterations [iter=500] %% g - name of the m-file for minimization method [g='glag_TV'] %% dt - factor of real time step delta_t=dt*h^2 [dt=0.5] %% h - spatial stepsize [h=1/max(size(I))] %% (default values are in []) %% Output: J - evolved image %% T - evolved time %% %% On the aforementioned example, %% about 10000 Iterations give precision 3-5 * 10^(-3) with dt=0.5 [ny,nx]=size(I); I=double(I); if ~exist('iter') iter=500 end if ~exist('sigma') sigma=0.1 end if ~exist('h') h=1/max([ny,nx]) end if ~exist('dt') dt=0.5 end if ~exist('g') g='glag_TV' end k=0; T=0; I0=I; c=sqrt(nx*ny)*sigma; while (k