From 41f75309fa39b18a201933d7fa005d7971239d43 Mon Sep 17 00:00:00 2001 From: Stefan van der Walt Date: Mon, 26 Sep 2011 21:44:21 -0700 Subject: [PATCH] BUG: fast_homography should ensure input data is contiguous. --- scikits/image/transform/_project.pyx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scikits/image/transform/_project.pyx b/scikits/image/transform/_project.pyx index 3e2b9b7d..734d6bff 100644 --- a/scikits/image/transform/_project.pyx +++ b/scikits/image/transform/_project.pyx @@ -150,9 +150,9 @@ def homography(np.ndarray image, np.ndarray H, output_shape=None, """ - cdef np.ndarray[dtype=np.double_t, ndim=2] img = \ - np.asarray(image, dtype=np.double) - cdef np.ndarray[dtype=np.double_t, ndim=2] M = \ + cdef np.ndarray[dtype=np.double_t, ndim=2, mode="c"] img = \ + np.ascontiguousarray(image, dtype=np.double) + cdef np.ndarray[dtype=np.double_t, ndim=2, mode="c"] M = \ np.ascontiguousarray(np.linalg.inv(H)) if mode not in ('constant', 'wrap', 'mirror'):