summaryrefslogtreecommitdiffstats
path: root/demos
diff options
context:
space:
mode:
authorDaniil Kazantsev <dkazanc@hotmail.com>2019-05-14 16:13:39 +0100
committerDaniil Kazantsev <dkazanc@hotmail.com>2019-05-14 16:13:39 +0100
commitd000db76c60654cdb0b07ea7f7967ceeebfbd73a (patch)
tree0868a70bcc1c0c43091bc760de932638898ded99 /demos
parent76241b2a0eb03d5326a70a914cb649239c066e01 (diff)
downloadregularization-d000db76c60654cdb0b07ea7f7967ceeebfbd73a.tar.gz
regularization-d000db76c60654cdb0b07ea7f7967ceeebfbd73a.tar.bz2
regularization-d000db76c60654cdb0b07ea7f7967ceeebfbd73a.tar.xz
regularization-d000db76c60654cdb0b07ea7f7967ceeebfbd73a.zip
fixes all matlab issues
Diffstat (limited to 'demos')
-rw-r--r--demos/Matlab_demos/demoMatlab_3Ddenoise.m (renamed from demos/demoMatlab_3Ddenoise.m)10
-rw-r--r--demos/Matlab_demos/demoMatlab_denoise.m (renamed from demos/demoMatlab_denoise.m)10
-rw-r--r--demos/Matlab_demos/demoMatlab_inpaint.m (renamed from demos/demoMatlab_inpaint.m)9
3 files changed, 18 insertions, 11 deletions
diff --git a/demos/demoMatlab_3Ddenoise.m b/demos/Matlab_demos/demoMatlab_3Ddenoise.m
index 3942eea..d7ff60c 100644
--- a/demos/demoMatlab_3Ddenoise.m
+++ b/demos/Matlab_demos/demoMatlab_3Ddenoise.m
@@ -1,8 +1,11 @@
% Volume (3D) denoising demo using CCPi-RGL
clear; close all
-Path1 = sprintf(['..' filesep 'src' filesep 'Matlab' filesep 'mex_compile' filesep 'installed'], 1i);
-Path2 = sprintf(['data' filesep], 1i);
-Path3 = sprintf(['..' filesep 'src' filesep 'Matlab' filesep 'supp'], 1i);
+fsep = '/';
+
+
+Path1 = sprintf(['..' fsep '..' fsep 'src' fsep 'Matlab' fsep 'mex_compile' fsep 'installed'], 1i);
+Path2 = sprintf(['..' fsep 'data' fsep], 1i);
+Path3 = sprintf(['..' fsep '..' fsep 'src' fsep 'Matlab' fsep 'supp'], 1i);
addpath(Path1);
addpath(Path2);
addpath(Path3);
@@ -18,7 +21,6 @@ Ideal3D(:,:,i) = Im;
end
vol3D(vol3D < 0) = 0;
figure; imshow(vol3D(:,:,7), [0 1]); title('Noisy image');
-
%%
fprintf('Denoise a volume using the ROF-TV model (CPU) \n');
lambda_reg = 0.03; % regularsation parameter for all methods
diff --git a/demos/demoMatlab_denoise.m b/demos/Matlab_demos/demoMatlab_denoise.m
index 9d89138..5af927f 100644
--- a/demos/demoMatlab_denoise.m
+++ b/demos/Matlab_demos/demoMatlab_denoise.m
@@ -2,9 +2,9 @@
clear; close all
fsep = '/';
-Path1 = sprintf(['..' fsep 'src' fsep 'Matlab' fsep 'mex_compile' fsep 'installed'], 1i);
-Path2 = sprintf(['data' fsep], 1i);
-Path3 = sprintf(['..' fsep 'src' fsep 'Matlab' fsep 'supp'], 1i);
+Path1 = sprintf(['..' fsep '..' fsep 'src' fsep 'Matlab' fsep 'mex_compile' fsep 'installed'], 1i);
+Path2 = sprintf(['..' fsep 'data' fsep], 1i);
+Path3 = sprintf(['..' fsep '..' fsep 'src' fsep 'Matlab' fsep 'supp'], 1i);
addpath(Path1);
addpath(Path2);
addpath(Path3);
@@ -15,8 +15,8 @@ figure; imshow(u0, [0 1]); title('Noisy image');
%%
fprintf('Denoise using the ROF-TV model (CPU) \n');
lambda_reg = 0.03; % regularsation parameter for all methods
-iter_rof = 2000; % number of ROF iterations
-tau_rof = 0.01; % time-marching constant
+iter_rof = 1500; % number of ROF iterations
+tau_rof = 0.003; % time-marching constant
epsil_tol = 0.0; % tolerance / 1.0e-06
tic; [u_rof,infovec] = ROF_TV(single(u0), lambda_reg, iter_rof, tau_rof, epsil_tol); toc;
energyfunc_val_rof = TV_energy(single(u_rof),single(u0),lambda_reg, 1); % get energy function value
diff --git a/demos/demoMatlab_inpaint.m b/demos/Matlab_demos/demoMatlab_inpaint.m
index a85f2b9..67a6a23 100644
--- a/demos/demoMatlab_inpaint.m
+++ b/demos/Matlab_demos/demoMatlab_inpaint.m
@@ -1,9 +1,14 @@
% Image (2D) inpainting demo using CCPi-RGL
clear; close all
-Path1 = sprintf(['..' filesep 'src' filesep 'Matlab' filesep 'mex_compile' filesep 'installed'], 1i);
-Path2 = sprintf(['data' filesep], 1i);
+
+fsep = '/';
+
+Path1 = sprintf(['..' fsep '..' fsep 'src' fsep 'Matlab' fsep 'mex_compile' fsep 'installed'], 1i);
+Path2 = sprintf(['..' fsep 'data' fsep], 1i);
+Path3 = sprintf(['..' fsep '..' fsep 'src' fsep 'Matlab' fsep 'supp'], 1i);
addpath(Path1);
addpath(Path2);
+addpath(Path3);
load('SinoInpaint.mat');
Sinogram = Sinogram./max(Sinogram(:));