summaryrefslogtreecommitdiffstats
path: root/Wrappers/Python/ccpi
diff options
context:
space:
mode:
authorDaniil Kazantsev <dkazanc@hotmail.com>2018-05-23 15:41:35 +0100
committerDaniil Kazantsev <dkazanc@hotmail.com>2018-05-23 15:41:35 +0100
commite53d631a2d0c34915459028e3db64153c3a936c3 (patch)
tree86601c3ccf2c3b21a307e484b9cf35f1bd364fed /Wrappers/Python/ccpi
parent601cd64a26786cf27a4ea1083bca146094909799 (diff)
downloadregularization-e53d631a2d0c34915459028e3db64153c3a936c3.tar.gz
regularization-e53d631a2d0c34915459028e3db64153c3a936c3.tar.bz2
regularization-e53d631a2d0c34915459028e3db64153c3a936c3.tar.xz
regularization-e53d631a2d0c34915459028e3db64153c3a936c3.zip
TGV for CPU and GPU added with demos
Diffstat (limited to 'Wrappers/Python/ccpi')
-rw-r--r--Wrappers/Python/ccpi/filters/regularisers.py24
1 files changed, 22 insertions, 2 deletions
diff --git a/Wrappers/Python/ccpi/filters/regularisers.py b/Wrappers/Python/ccpi/filters/regularisers.py
index 0b79dac..0e435a6 100644
--- a/Wrappers/Python/ccpi/filters/regularisers.py
+++ b/Wrappers/Python/ccpi/filters/regularisers.py
@@ -2,8 +2,8 @@
script which assigns a proper device core function based on a flag ('cpu' or 'gpu')
"""
-from ccpi.filters.cpu_regularisers import TV_ROF_CPU, TV_FGP_CPU, TV_SB_CPU, dTV_FGP_CPU, TNV_CPU, NDF_CPU, Diff4th_CPU
-from ccpi.filters.gpu_regularisers import TV_ROF_GPU, TV_FGP_GPU, TV_SB_GPU, dTV_FGP_GPU, NDF_GPU, Diff4th_GPU
+from ccpi.filters.cpu_regularisers import TV_ROF_CPU, TV_FGP_CPU, TV_SB_CPU, dTV_FGP_CPU, TNV_CPU, NDF_CPU, Diff4th_CPU, TGV_CPU
+from ccpi.filters.gpu_regularisers import TV_ROF_GPU, TV_FGP_GPU, TV_SB_GPU, dTV_FGP_GPU, NDF_GPU, Diff4th_GPU, TGV_GPU
from ccpi.filters.cpu_regularisers import NDF_INPAINT_CPU, NVM_INPAINT_CPU
def ROF_TV(inputData, regularisation_parameter, iterations,
@@ -128,6 +128,26 @@ def DIFF4th(inputData, regularisation_parameter, edge_parameter, iterations,
else:
raise ValueError('Unknown device {0}. Expecting gpu or cpu'\
.format(device))
+def TGV(inputData, regularisation_parameter, alpha1, alpha0, iterations,
+ LipshitzConst, device='cpu'):
+ if device == 'cpu':
+ return TGV_CPU(inputData,
+ regularisation_parameter,
+ alpha1,
+ alpha0,
+ iterations,
+ LipshitzConst)
+ elif device == 'gpu':
+ return TGV_GPU(inputData,
+ regularisation_parameter,
+ alpha1,
+ alpha0,
+ iterations,
+ LipshitzConst)
+ else:
+ raise ValueError('Unknown device {0}. Expecting gpu or cpu'\
+ .format(device))
+
def NDF_INP(inputData, maskData, regularisation_parameter, edge_parameter, iterations,
time_marching_parameter, penalty_type):
return NDF_INPAINT_CPU(inputData, maskData, regularisation_parameter,