summaryrefslogtreecommitdiffstats
path: root/demos/demoMatlab_3Ddenoise.m
diff options
context:
space:
mode:
authorTomas Kulhanek <tomas.kulhanek@stfc.ac.uk>2019-02-22 07:50:37 -0500
committerTomas Kulhanek <tomas.kulhanek@stfc.ac.uk>2019-02-22 07:50:37 -0500
commit755b74b26f07f91fbffd19f3476da1f6ac16d774 (patch)
tree4bb4cf8c7576aa1773f0f5e8aa9600fc5a01ea64 /demos/demoMatlab_3Ddenoise.m
parentc237d292999c93df09ca3679876d225896dd0ff9 (diff)
parent9b4058fbf779221ed7d37bfc6e7c838b294c5965 (diff)
downloadregularization-755b74b26f07f91fbffd19f3476da1f6ac16d774.tar.gz
regularization-755b74b26f07f91fbffd19f3476da1f6ac16d774.tar.bz2
regularization-755b74b26f07f91fbffd19f3476da1f6ac16d774.tar.xz
regularization-755b74b26f07f91fbffd19f3476da1f6ac16d774.zip
Merge remote-tracking branch 'remotes/origin/master' into newdirstructure
Conflicts: demos/demoMatlab_denoise.m demos/qualitymetrics.py
Diffstat (limited to 'demos/demoMatlab_3Ddenoise.m')
-rw-r--r--demos/demoMatlab_3Ddenoise.m16
1 files changed, 12 insertions, 4 deletions
diff --git a/demos/demoMatlab_3Ddenoise.m b/demos/demoMatlab_3Ddenoise.m
index cdd3117..cf2c88a 100644
--- a/demos/demoMatlab_3Ddenoise.m
+++ b/demos/demoMatlab_3Ddenoise.m
@@ -8,7 +8,7 @@ addpath(Path2);
addpath(Path3);
N = 512;
-slices = 7;
+slices = 15;
vol3D = zeros(N,N,slices, 'single');
Ideal3D = zeros(N,N,slices, 'single');
Im = double(imread('lena_gray_512.tif'))/255; % loading image
@@ -17,9 +17,7 @@ vol3D(:,:,i) = Im + .05*randn(size(Im));
Ideal3D(:,:,i) = Im;
end
vol3D(vol3D < 0) = 0;
-figure; imshow(vol3D(:,:,15), [0 1]); title('Noisy image');
-
-
+figure; imshow(vol3D(:,:,7), [0 1]); title('Noisy image');
lambda_reg = 0.03; % regularsation parameter for all methods
%%
fprintf('Denoise a volume using the ROF-TV model (CPU) \n');
@@ -143,6 +141,16 @@ 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)');
%%
+% fprintf('Denoise using the TGV model (GPU) \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
+% iter_TGV = 500; % number of Primal-Dual iterations for TGV
+% tic; u_tgv_gpu = TGV_GPU(single(vol3D), lambda_TGV, alpha1, alpha0, iter_TGV); 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)');
+%%
%>>>>>>>>>>>>>> MULTI-CHANNEL priors <<<<<<<<<<<<<<< %
fprintf('Denoise a volume using the FGP-dTV model (CPU) \n');