From ff082d283c4da4e1cd54721da3eeb92cc01cc845 Mon Sep 17 00:00:00 2001 From: Pratap Vardhan Date: Wed, 11 Nov 2015 20:00:54 +0530 Subject: [PATCH] BUG: Buffer dtype mismatch, expected 'Py_ssize_t' but got 'long' --- skimage/feature/_texture.pyx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/skimage/feature/_texture.pyx b/skimage/feature/_texture.pyx index b90ab6dd..57d8ec81 100644 --- a/skimage/feature/_texture.pyx +++ b/skimage/feature/_texture.pyx @@ -271,8 +271,8 @@ def _local_binary_pattern(double[:, ::1] image, # Values represent offsets of neighbour rectangles relative to central one. # It has order starting from top left and going clockwise. cdef: - Py_ssize_t[::1] mlbp_r_offsets = np.asarray([-1, -1, -1, 0, 1, 1, 1, 0]) - Py_ssize_t[::1] mlbp_c_offsets = np.asarray([-1, 0, 1, 1, 1, 0, -1, -1]) + Py_ssize_t[::1] mlbp_r_offsets = np.asarray([-1, -1, -1, 0, 1, 1, 1, 0], dtype=np.intp) + Py_ssize_t[::1] mlbp_c_offsets = np.asarray([-1, 0, 1, 1, 1, 0, -1, -1], dtype=np.intp) def _multiblock_lbp(float[:, ::1] int_image,