summaryrefslogtreecommitdiffstats
path: root/demos
diff options
context:
space:
mode:
authorDaniil Kazantsev <dkazanc@hotmail.com>2019-03-16 23:39:29 +0000
committerDaniil Kazantsev <dkazanc@hotmail.com>2019-03-16 23:39:29 +0000
commit9633c5d701c164c3ff8f4d870624f87744d186bd (patch)
tree23fd9a110436318aa55cbb46a6f86824940b5478 /demos
parent1740fb91c1842dc174492857fad88c03420f74eb (diff)
downloadregularization-9633c5d701c164c3ff8f4d870624f87744d186bd.tar.gz
regularization-9633c5d701c164c3ff8f4d870624f87744d186bd.tar.bz2
regularization-9633c5d701c164c3ff8f4d870624f87744d186bd.tar.xz
regularization-9633c5d701c164c3ff8f4d870624f87744d186bd.zip
matlab demos updated
Diffstat (limited to 'demos')
-rw-r--r--demos/demoMatlab_3Ddenoise.m5
-rw-r--r--demos/demoMatlab_denoise.m9
2 files changed, 8 insertions, 6 deletions
diff --git a/demos/demoMatlab_3Ddenoise.m b/demos/demoMatlab_3Ddenoise.m
index 6b21e86..3942eea 100644
--- a/demos/demoMatlab_3Ddenoise.m
+++ b/demos/demoMatlab_3Ddenoise.m
@@ -145,9 +145,10 @@ fprintf('Denoise using the TGV model (CPU) \n');
lambda_TGV = 0.03; % regularisation parameter
alpha1 = 1.0; % parameter to control the first-order term
alpha0 = 2.0; % parameter to control the second-order term
+L2 = 12.0; % convergence parameter
iter_TGV = 500; % number of Primal-Dual iterations for TGV
epsil_tol = 0.0; % tolerance
-tic; u_tgv = TGV(single(vol3D), lambda_TGV, alpha1, alpha0, iter_TGV, epsil_tol); toc;
+tic; u_tgv = TGV(single(vol3D), lambda_TGV, alpha1, alpha0, iter_TGV, L2, epsil_tol); toc;
rmseTGV = RMSE(Ideal3D(:),u_tgv(:));
fprintf('%s %f \n', 'RMSE error for TGV is:', rmseTGV);
figure; imshow(u_tgv(:,:,3), [0 1]); title('TGV denoised volume (CPU)');
@@ -157,7 +158,7 @@ figure; imshow(u_tgv(:,:,3), [0 1]); title('TGV denoised volume (CPU)');
% alpha1 = 1.0; % parameter to control the first-order term
% alpha0 = 2.0; % parameter to control the second-order term
% iter_TGV = 500; % number of Primal-Dual iterations for TGV
-% tic; u_tgv_gpu = TGV_GPU(single(vol3D), lambda_TGV, alpha1, alpha0, iter_TGV, epsil_tol); toc;
+% tic; u_tgv_gpu = TGV_GPU(single(vol3D), lambda_TGV, alpha1, alpha0, iter_TGV, L2, epsil_tol); toc;
% rmseTGV = RMSE(Ideal3D(:),u_tgv_gpu(:));
% fprintf('%s %f \n', 'RMSE error for TGV is:', rmseTGV);
% figure; imshow(u_tgv_gpu(:,:,3), [0 1]); title('TGV denoised volume (GPU)');
diff --git a/demos/demoMatlab_denoise.m b/demos/demoMatlab_denoise.m
index 377a447..9d89138 100644
--- a/demos/demoMatlab_denoise.m
+++ b/demos/demoMatlab_denoise.m
@@ -83,17 +83,18 @@ fprintf('Denoise using the TGV model (CPU) \n');
lambda_TGV = 0.035; % regularisation parameter
alpha1 = 1.0; % parameter to control the first-order term
alpha0 = 2.0; % parameter to control the second-order term
-iter_TGV = 20; % number of Primal-Dual iterations for TGV
+L2 = 12.0; % convergence parameter
+iter_TGV = 1200; % number of Primal-Dual iterations for TGV
epsil_tol = 0.0; % tolerance
-tic; [u_tgv,infovec] = TGV(single(u0), lambda_TGV, alpha1, alpha0, iter_TGV, epsil_tol); toc;
+tic; [u_tgv,infovec] = TGV(single(u0), lambda_TGV, alpha1, alpha0, iter_TGV, L2, epsil_tol); toc;
+figure; imshow(u_tgv, [0 1]); title('TGV denoised image (CPU)');
rmseTGV = (RMSE(u_tgv(:),Im(:)));
fprintf('%s %f \n', 'RMSE error for TGV is:', rmseTGV);
[ssimval] = ssim(u_tgv*255,single(Im)*255);
fprintf('%s %f \n', 'MSSIM error for TGV is:', ssimval);
-figure; imshow(u_tgv, [0 1]); title('TGV denoised image (CPU)');
%%
% fprintf('Denoise using the TGV model (GPU) \n');
-% tic; u_tgv_gpu = TGV_GPU(single(u0), lambda_TGV, alpha1, alpha0, iter_TGV, epsil_tol); toc;
+% tic; u_tgv_gpu = TGV_GPU(single(u0), lambda_TGV, alpha1, alpha0, iter_TGV, L2, epsil_tol); toc;
% figure; imshow(u_tgv_gpu, [0 1]); title('TGV denoised image (GPU)');
%%
fprintf('Denoise using the ROF-LLT model (CPU) \n');