From ff082d283c4da4e1cd54721da3eeb92cc01cc845 Mon Sep 17 00:00:00 2001 From: Pratap Vardhan Date: Wed, 11 Nov 2015 20:00:54 +0530 Subject: [PATCH 1/2] 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, From d8213fe814c5e2224e6cf2b12dc154b83a76f320 Mon Sep 17 00:00:00 2001 From: Pratap Vardhan Date: Wed, 11 Nov 2015 20:18:00 +0530 Subject: [PATCH 2/2] BUG: Buffer dtype mismatch in _seam_carving.pyx --- skimage/transform/_seam_carving.pyx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/skimage/transform/_seam_carving.pyx b/skimage/transform/_seam_carving.pyx index 3499514c..73306bb3 100644 --- a/skimage/transform/_seam_carving.pyx +++ b/skimage/transform/_seam_carving.pyx @@ -180,7 +180,7 @@ def _seam_carve_v(img, energy_map, iters, border): cdef Py_ssize_t seams_left = iters cdef Py_ssize_t seams_removed cdef Py_ssize_t seam_idx - cdef Py_ssize_t[::1] seam_buffer = np.zeros(rows, dtype=np.int) + cdef Py_ssize_t[::1] seam_buffer = np.zeros(rows, dtype=np.intp) cdef cnp.double_t[:, :, ::1] image = img cdef cnp.int8_t[:, ::1] track_img = np.zeros(img.shape[0:2], dtype=np.int8)