Merge pull request #1782 from pratapvardhan/clncython

BUG: Buffer dtype mismatch, expected 'Py_ssize_t' but got 'long'
This commit is contained in:
Emmanuelle Gouillart
2015-12-23 15:35:05 +01:00
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -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,
+1 -1
View File
@@ -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)