From 984e542425a1dbb8086e892cb8af1a45a5698648 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Sun, 30 Jun 2013 12:42:11 +0200 Subject: [PATCH] Use missing memoryviews for bilateral kernels --- skimage/filter/rank/bilateral16_cy.pyx | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/skimage/filter/rank/bilateral16_cy.pyx b/skimage/filter/rank/bilateral16_cy.pyx index 63a89453..f5614157 100644 --- a/skimage/filter/rank/bilateral16_cy.pyx +++ b/skimage/filter/rank/bilateral16_cy.pyx @@ -4,7 +4,7 @@ #cython: wraparound=False cimport numpy as cnp -from .core16_cy cimport _core16 +from .core16_cy cimport dtype_t, _core16 # ----------------------------------------------------------------- @@ -12,9 +12,6 @@ from .core16_cy cimport _core16 # ----------------------------------------------------------------- -ctypedef cnp.uint16_t dtype_t - - cdef inline dtype_t kernel_mean(Py_ssize_t* histo, float pop, dtype_t g, Py_ssize_t bitdepth, Py_ssize_t maxbin, Py_ssize_t midbin, @@ -59,10 +56,10 @@ cdef inline dtype_t kernel_pop(Py_ssize_t* histo, float pop, # ----------------------------------------------------------------- -def mean(cnp.ndarray[dtype_t, ndim=2] image, - cnp.ndarray[cnp.uint8_t, ndim=2] selem, - cnp.ndarray[cnp.uint8_t, ndim=2] mask=None, - cnp.ndarray[dtype_t, ndim=2] out=None, +def mean(dtype_t[:, ::1] image, + char[:, ::1] selem, + char[:, ::1] mask=None, + dtype_t[:, ::1] out=None, char shift_x=0, char shift_y=0, int bitdepth=8, int s0=1, int s1=1): """average greylevel (clipped on uint8) """ @@ -70,10 +67,10 @@ def mean(cnp.ndarray[dtype_t, ndim=2] image, bitdepth, 0., 0., s0, s1) -def pop(cnp.ndarray[dtype_t, ndim=2] image, - cnp.ndarray[cnp.uint8_t, ndim=2] selem, - cnp.ndarray[cnp.uint8_t, ndim=2] mask=None, - cnp.ndarray[dtype_t, ndim=2] out=None, +def pop(dtype_t[:, ::1] image, + char[:, ::1] selem, + char[:, ::1] mask=None, + dtype_t[:, ::1] out=None, char shift_x=0, char shift_y=0, int bitdepth=8, int s0=1, int s1=1): """returns the number of actual pixels of the structuring element inside the mask