summaryrefslogtreecommitdiffstats
path: root/Wrappers/Matlab/demos
diff options
context:
space:
mode:
authorDaniil Kazantsev <dkazanc@hotmail.com>2018-04-20 11:45:47 +0100
committerDaniil Kazantsev <dkazanc@hotmail.com>2018-04-20 11:45:47 +0100
commitc5d537b582894484f497e11bb883ff596efff268 (patch)
treea5bf27a666f1292077edae3d23cc789aba705c58 /Wrappers/Matlab/demos
parent8d7e53224216be05f869fd56fd8a6d8bcd611166 (diff)
downloadregularization-c5d537b582894484f497e11bb883ff596efff268.tar.gz
regularization-c5d537b582894484f497e11bb883ff596efff268.tar.bz2
regularization-c5d537b582894484f497e11bb883ff596efff268.tar.xz
regularization-c5d537b582894484f497e11bb883ff596efff268.zip
energy function calculation for TV models
Diffstat (limited to 'Wrappers/Matlab/demos')
-rw-r--r--Wrappers/Matlab/demos/demoMatlab_3Ddenoise.m3
-rw-r--r--Wrappers/Matlab/demos/demoMatlab_denoise.m8
2 files changed, 9 insertions, 2 deletions
diff --git a/Wrappers/Matlab/demos/demoMatlab_3Ddenoise.m b/Wrappers/Matlab/demos/demoMatlab_3Ddenoise.m
index 973d060..84889d7 100644
--- a/Wrappers/Matlab/demos/demoMatlab_3Ddenoise.m
+++ b/Wrappers/Matlab/demos/demoMatlab_3Ddenoise.m
@@ -21,6 +21,7 @@ fprintf('Denoise a volume using the ROF-TV model (CPU) \n');
tau_rof = 0.0025; % time-marching constant
iter_rof = 300; % number of ROF iterations
tic; u_rof = ROF_TV(single(vol3D), lambda_reg, iter_rof, tau_rof); toc;
+energyfunc_val_rof = TV_energy(single(u_rof),single(vol3D),lambda_reg); % get energy function value
figure; imshow(u_rof(:,:,15), [0 1]); title('ROF-TV denoised volume (CPU)');
%%
% fprintf('Denoise a volume using the ROF-TV model (GPU) \n');
@@ -33,6 +34,7 @@ fprintf('Denoise a volume using the FGP-TV model (CPU) \n');
iter_fgp = 300; % number of FGP iterations
epsil_tol = 1.0e-05; % tolerance
tic; u_fgp = FGP_TV(single(vol3D), lambda_reg, iter_fgp, epsil_tol); toc;
+energyfunc_val_fgp = TV_energy(single(u_fgp),single(vol3D),lambda_reg); % get energy function value
figure; imshow(u_fgp(:,:,15), [0 1]); title('FGP-TV denoised volume (CPU)');
%%
% fprintf('Denoise a volume using the FGP-TV model (GPU) \n');
@@ -45,6 +47,7 @@ fprintf('Denoise a volume using the SB-TV model (CPU) \n');
iter_sb = 150; % number of SB iterations
epsil_tol = 1.0e-05; % tolerance
tic; u_sb = SB_TV(single(vol3D), lambda_reg, iter_sb, epsil_tol); toc;
+energyfunc_val_sb = TV_energy(single(u_sb),single(vol3D),lambda_reg); % get energy function value
figure; imshow(u_sb(:,:,15), [0 1]); title('SB-TV denoised volume (CPU)');
%%
% fprintf('Denoise a volume using the SB-TV model (GPU) \n');
diff --git a/Wrappers/Matlab/demos/demoMatlab_denoise.m b/Wrappers/Matlab/demos/demoMatlab_denoise.m
index 4a0a19a..526d21c 100644
--- a/Wrappers/Matlab/demos/demoMatlab_denoise.m
+++ b/Wrappers/Matlab/demos/demoMatlab_denoise.m
@@ -12,13 +12,14 @@ lambda_reg = 0.03; % regularsation parameter for all methods
%%
fprintf('Denoise using the ROF-TV model (CPU) \n');
tau_rof = 0.0025; % time-marching constant
-iter_rof = 2000; % number of ROF iterations
+iter_rof = 750; % number of ROF iterations
tic; u_rof = ROF_TV(single(u0), lambda_reg, iter_rof, tau_rof); toc;
+energyfunc_val_rof = TV_energy(single(u_rof),single(u0),lambda_reg); % get energy function value
figure; imshow(u_rof, [0 1]); title('ROF-TV denoised image (CPU)');
%%
% fprintf('Denoise using the ROF-TV model (GPU) \n');
% tau_rof = 0.0025; % time-marching constant
-% iter_rof = 2000; % number of ROF iterations
+% iter_rof = 750; % number of ROF iterations
% tic; u_rofG = ROF_TV_GPU(single(u0), lambda_reg, iter_rof, tau_rof); toc;
% figure; imshow(u_rofG, [0 1]); title('ROF-TV denoised image (GPU)');
%%
@@ -26,7 +27,9 @@ fprintf('Denoise using the FGP-TV model (CPU) \n');
iter_fgp = 1000; % number of FGP iterations
epsil_tol = 1.0e-06; % tolerance
tic; u_fgp = FGP_TV(single(u0), lambda_reg, iter_fgp, epsil_tol); toc;
+energyfunc_val_fgp = TV_energy(single(u_fgp),single(u0),lambda_reg); % get energy function value
figure; imshow(u_fgp, [0 1]); title('FGP-TV denoised image (CPU)');
+
%%
% fprintf('Denoise using the FGP-TV model (GPU) \n');
% iter_fgp = 1000; % number of FGP iterations
@@ -38,6 +41,7 @@ fprintf('Denoise using the SB-TV model (CPU) \n');
iter_sb = 150; % number of SB iterations
epsil_tol = 1.0e-06; % tolerance
tic; u_sb = SB_TV(single(u0), lambda_reg, iter_sb, epsil_tol); toc;
+energyfunc_val_sb = TV_energy(single(u_sb),single(u0),lambda_reg); % get energy function value
figure; imshow(u_sb, [0 1]); title('SB-TV denoised image (CPU)');
%%
% fprintf('Denoise using the SB-TV model (GPU) \n');