summaryrefslogtreecommitdiffstats
path: root/Wrappers/Matlab/demos
diff options
context:
space:
mode:
authorDaniil Kazantsev <dkazanc@hotmail.com>2018-04-09 13:41:06 +0100
committerDaniil Kazantsev <dkazanc@hotmail.com>2018-04-09 13:41:06 +0100
commitb9fafd363d1d181a4a8b42ea4038924097207913 (patch)
treecdc7c4469e210a52cb416b2747ca2d954da073cc /Wrappers/Matlab/demos
parenta5b5872b76bf00023a7e7cee97e028003ccbc45e (diff)
downloadregularization-b9fafd363d1d181a4a8b42ea4038924097207913.tar.gz
regularization-b9fafd363d1d181a4a8b42ea4038924097207913.tar.bz2
regularization-b9fafd363d1d181a4a8b42ea4038924097207913.tar.xz
regularization-b9fafd363d1d181a4a8b42ea4038924097207913.zip
major renaming and new 3D demos for Matlab
Diffstat (limited to 'Wrappers/Matlab/demos')
-rw-r--r--Wrappers/Matlab/demos/demoMatlab_3Ddenoise.m44
-rw-r--r--Wrappers/Matlab/demos/demoMatlab_denoise.m8
2 files changed, 48 insertions, 4 deletions
diff --git a/Wrappers/Matlab/demos/demoMatlab_3Ddenoise.m b/Wrappers/Matlab/demos/demoMatlab_3Ddenoise.m
new file mode 100644
index 0000000..f5c3ad1
--- /dev/null
+++ b/Wrappers/Matlab/demos/demoMatlab_3Ddenoise.m
@@ -0,0 +1,44 @@
+% Volume (3D) denoising demo using CCPi-RGL
+
+addpath('../mex_compile/installed');
+addpath('../../../data/');
+
+N = 256;
+slices = 30;
+vol3D = zeros(N,N,slices, 'single');
+Im = double(imread('lena_gray_256.tif'))/255; % loading image
+for i = 1:slices
+vol3D(:,:,i) = Im + .05*randn(size(Im));
+end
+vol3D(vol3D < 0) = 0;
+figure; imshow(vol3D(:,:,15), [0 1]); title('Noisy image');
+
+%%
+fprintf('Denoise using ROF-TV model (CPU) \n');
+lambda_rof = 0.03; % regularisation parameter
+tau_rof = 0.0025; % time-marching constant
+iter_rof = 1000; % number of ROF iterations
+tic; u_rof = ROF_TV(single(vol3D), lambda_rof, iter_rof, tau_rof); toc;
+figure; imshow(u_rof(:,:,15), [0 1]); title('ROF-TV denoised volume (CPU)');
+%%
+% fprintf('Denoise using ROF-TV model (GPU) \n');
+% lambda_rof = 0.03; % regularisation parameter
+% tau_rof = 0.0025; % time-marching constant
+% iter_rof = 1000; % number of ROF iterations
+% tic; u_rofG = ROF_TV_GPU(single(vol3D), lambda_rof, iter_rof, tau_rof); toc;
+% figure; imshow(u_rofG(:,:,15), [0 1]); title('ROF-TV denoised volume (GPU)');
+%%
+fprintf('Denoise using FGP-TV model (CPU) \n');
+lambda_fgp = 0.03; % regularisation parameter
+iter_fgp = 500; % number of FGP iterations
+epsil_tol = 1.0e-05; % tolerance
+tic; u_fgp = FGP_TV(single(vol3D), lambda_fgp, iter_fgp, epsil_tol); toc;
+figure; imshow(u_fgp(:,:,15), [0 1]); title('FGP-TV denoised volume (CPU)');
+%%
+% fprintf('Denoise using FGP-TV model (GPU) \n');
+% lambda_fgp = 0.03; % regularisation parameter
+% iter_fgp = 500; % number of FGP iterations
+% epsil_tol = 1.0e-05; % tolerance
+% tic; u_fgpG = FGP_TV_GPU(single(vol3D), lambda_fgp, iter_fgp, epsil_tol); toc;
+% figure; imshow(u_fgpG(:,:,15), [0 1]); title('FGP-TV denoised volume (GPU)');
+%% \ No newline at end of file
diff --git a/Wrappers/Matlab/demos/demoMatlab_denoise.m b/Wrappers/Matlab/demos/demoMatlab_denoise.m
index 7258e5e..ab4e95d 100644
--- a/Wrappers/Matlab/demos/demoMatlab_denoise.m
+++ b/Wrappers/Matlab/demos/demoMatlab_denoise.m
@@ -9,28 +9,28 @@ figure; imshow(u0, [0 1]); title('Noisy image');
%%
fprintf('Denoise using ROF-TV model (CPU) \n');
-lambda_rof = 0.03; % regularization parameter
+lambda_rof = 0.03; % regularisation parameter
tau_rof = 0.0025; % time-marching constant
iter_rof = 2000; % number of ROF iterations
tic; u_rof = ROF_TV(single(u0), lambda_rof, iter_rof, tau_rof); toc;
figure; imshow(u_rof, [0 1]); title('ROF-TV denoised image (CPU)');
%%
% fprintf('Denoise using ROF-TV model (GPU) \n');
-% lambda_rof = 0.03; % regularization parameter
+% lambda_rof = 0.03; % regularisation parameter
% tau_rof = 0.0025; % time-marching constant
% iter_rof = 2000; % number of ROF iterations
% tic; u_rofG = ROF_TV_GPU(single(u0), lambda_rof, iter_rof, tau_rof); toc;
% figure; imshow(u_rofG, [0 1]); title('ROF-TV denoised image (GPU)');
%%
fprintf('Denoise using FGP-TV model (CPU) \n');
-lambda_fgp = 0.03; % regularization parameter
+lambda_fgp = 0.03; % regularisation parameter
iter_fgp = 1000; % number of FGP iterations
epsil_tol = 1.0e-05; % tolerance
tic; u_fgp = FGP_TV(single(u0), lambda_fgp, iter_fgp, epsil_tol); toc;
figure; imshow(u_fgp, [0 1]); title('FGP-TV denoised image (CPU)');
%%
% fprintf('Denoise using FGP-TV model (GPU) \n');
-% lambda_fgp = 0.03; % regularization parameter
+% lambda_fgp = 0.03; % regularisation parameter
% iter_fgp = 1000; % number of FGP iterations
% epsil_tol = 1.0e-05; % tolerance
% tic; u_fgpG = FGP_TV_GPU(single(u0), lambda_fgp, iter_fgp, epsil_tol); toc;