diff options
author | Edoardo Pasca <edo.paskino@gmail.com> | 2018-01-30 11:36:59 +0000 |
---|---|---|
committer | Edoardo Pasca <edo.paskino@gmail.com> | 2018-01-30 12:03:59 +0000 |
commit | 0b1ee0c14e8962edbd496652ebcddc09274fad62 (patch) | |
tree | 03430524792f98dd95243c9f48387efbb681bb47 /Wrappers | |
parent | 56a94d0e2bf32a5951482dc9dc3c4c4c652755fb (diff) | |
download | regularization-0b1ee0c14e8962edbd496652ebcddc09274fad62.tar.gz regularization-0b1ee0c14e8962edbd496652ebcddc09274fad62.tar.bz2 regularization-0b1ee0c14e8962edbd496652ebcddc09274fad62.tar.xz regularization-0b1ee0c14e8962edbd496652ebcddc09274fad62.zip |
fix GPU regularizer
Diffstat (limited to 'Wrappers')
-rw-r--r-- | Wrappers/Python/CMakeLists.txt | 3 | ||||
-rw-r--r-- | Wrappers/Python/src/gpu_regularizers.pyx | 39 |
2 files changed, 21 insertions, 21 deletions
diff --git a/Wrappers/Python/CMakeLists.txt b/Wrappers/Python/CMakeLists.txt index 3f95660..16a2137 100644 --- a/Wrappers/Python/CMakeLists.txt +++ b/Wrappers/Python/CMakeLists.txt @@ -89,7 +89,8 @@ message ("found " ${BOOST_NUMPY_LIB}) find_package(CUDA) if (CUDA_FOUND) message("CUDA FOUND") - set (SETUP_GPU_WRAPPERS "setup( \n\ + set (SETUP_GPU_WRAPPERS "extra_libraries += ['cilregcuda']\n\ +setup( \n\ name='ccpi', \n\ description='CCPi Core Imaging Library - Image Regularizers GPU',\n\ version=cil_version,\n\ diff --git a/Wrappers/Python/src/gpu_regularizers.pyx b/Wrappers/Python/src/gpu_regularizers.pyx index 7658e36..dc625c3 100644 --- a/Wrappers/Python/src/gpu_regularizers.pyx +++ b/Wrappers/Python/src/gpu_regularizers.pyx @@ -44,7 +44,25 @@ def Diff4thHajiaboli(inputData, regularization_parameter, iterations, edge_preserving_parameter) - + +def NML(inputData, + SearchW_real, + SimilW, + h, + lambdaf): + if inputData.ndim == 2: + return NML2D(inputData, + SearchW_real, + SimilW, + h, + lambdaf) + elif inputData.ndim == 3: + return NML3D(inputData, + SearchW_real, + SimilW, + h, + lambdaf) + def Diff4thHajiaboli2D(np.ndarray[np.float32_t, ndim=2, mode="c"] inputData, float regularization_parameter, int iterations, @@ -160,25 +178,6 @@ def Diff4thHajiaboli3D(np.ndarray[np.float32_t, ndim=3, mode="c"] inputData, return B -def NML(inputData, - regularization_parameter, - iterations, - edge_preserving_parameter): - if inputData.ndim == 2: - return NML2D(inputData, - regularization_parameter, - iterations, - edge_preserving_parameter) - elif inputData.ndim == 3: - return NML3D(inputData, - regularization_parameter, - iterations, - edge_preserving_parameter) - - #SearchW_real = (int) mxGetScalar(prhs[1]); /* the searching window ratio */ - #SimilW = (int) mxGetScalar(prhs[2]); /* the similarity window ratio */ - #h = (float) mxGetScalar(prhs[3]); /* parameter for the PB filtering function */ - #lambda = (float) mxGetScalar(prhs[4]); def NML2D(np.ndarray[np.float32_t, ndim=2, mode="c"] inputData, SearchW_real, |