summaryrefslogtreecommitdiffstats
path: root/Wrappers/Matlab/demos
diff options
context:
space:
mode:
authorDaniil Kazantsev <dkazanc3@googlemail.com>2018-12-02 19:10:01 +0000
committerGitHub <noreply@github.com>2018-12-02 19:10:01 +0000
commit8b8dfc68fa6b70ec7eefcdfb928fb383196bec97 (patch)
tree2e0bbebd15b90ec493e381d07e89613aa2df55f0 /Wrappers/Matlab/demos
parenta106da50c7f428db2e4115fe1bdc0c156a933a21 (diff)
parentb1651143a6d3c27ba4f6aea3dd0fb799799b2eca (diff)
downloadregularization-8b8dfc68fa6b70ec7eefcdfb928fb383196bec97.tar.gz
regularization-8b8dfc68fa6b70ec7eefcdfb928fb383196bec97.tar.bz2
regularization-8b8dfc68fa6b70ec7eefcdfb928fb383196bec97.tar.xz
regularization-8b8dfc68fa6b70ec7eefcdfb928fb383196bec97.zip
Merge pull request #73 from vais-ral/NLTV
Nonlocal TV method added (CPU version)
Diffstat (limited to 'Wrappers/Matlab/demos')
-rw-r--r--Wrappers/Matlab/demos/demoMatlab_denoise.m16
1 files changed, 15 insertions, 1 deletions
diff --git a/Wrappers/Matlab/demos/demoMatlab_denoise.m b/Wrappers/Matlab/demos/demoMatlab_denoise.m
index d11bc63..54b8bac 100644
--- a/Wrappers/Matlab/demos/demoMatlab_denoise.m
+++ b/Wrappers/Matlab/demos/demoMatlab_denoise.m
@@ -135,7 +135,21 @@ figure; imshow(u_diff4, [0 1]); title('Diffusion 4thO denoised image (CPU)');
% tic; u_diff4_g = Diffusion_4thO_GPU(single(u0), lambda_regDiff, sigmaPar, iter_diff, tau_param); toc;
% figure; imshow(u_diff4_g, [0 1]); title('Diffusion 4thO denoised image (GPU)');
%%
-
+fprintf('Weights pre-calculation for Non-local TV (takes time on CPU) \n');
+SearchingWindow = 7;
+PatchWindow = 2;
+NeighboursNumber = 15; % the number of neibours to include
+h = 0.23; % edge related parameter for NLM
+[H_i, H_j, Weights] = PatchSelect(single(u0), SearchingWindow, PatchWindow, NeighboursNumber, h);
+%%
+fprintf('Denoise using Non-local Total Variation (CPU) \n');
+iter_nltv = 2; % number of nltv iterations
+lambda_nltv = 0.085; % regularisation parameter for nltv
+tic; u_nltv = Nonlocal_TV(single(u0), H_i, H_j, 0, Weights, lambda_nltv, iter_nltv); toc;
+rmse_nltv = (RMSE(u_nltv(:),Im(:)));
+fprintf('%s %f \n', 'RMSE error for Non-local Total Variation is:', rmse_nltv);
+figure; imshow(u_nltv, [0 1]); title('Non-local Total Variation denoised image (CPU)');
+%%
%>>>>>>>>>>>>>> MULTI-CHANNEL priors <<<<<<<<<<<<<<< %
fprintf('Denoise using the FGP-dTV model (CPU) \n');