clear
close all
format compact

%% Parameter
beta=0.35;
tau = .2;
theta = 1e-3;

%% Read data
disp('reading file');
f = imread('filter2dkl.pgm');
%f = imread('kreiskl.pgm');
%f = imread('filter2d.pgm');
f = double(f) / 255.;
h = 1;

%% Rudin-Osher-Fatemi-denoising
f = rof(f,beta,tau,h,theta,10000);

%% Plot
imwrite(f,'TVL2.pgm','pgm');
imshow(f,[0,1]);
