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 11:36:59 +0000 |
commit | 0261bc73703c835c8c15fd47229317f44d1663ea (patch) | |
tree | 03430524792f98dd95243c9f48387efbb681bb47 /Wrappers/Python/src | |
parent | 40b40318d66be25c084c7deef7a3c00fdb20a618 (diff) | |
download | regularization-0261bc73703c835c8c15fd47229317f44d1663ea.tar.gz regularization-0261bc73703c835c8c15fd47229317f44d1663ea.tar.bz2 regularization-0261bc73703c835c8c15fd47229317f44d1663ea.tar.xz regularization-0261bc73703c835c8c15fd47229317f44d1663ea.zip |
fix GPU regularizer
Diffstat (limited to 'Wrappers/Python/src')
-rw-r--r-- | Wrappers/Python/src/gpu_regularizers.pyx | 39 |
1 files changed, 19 insertions, 20 deletions
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, |