From d243713848839301c609fb0dee23ba094e241896 Mon Sep 17 00:00:00 2001 From: Stefan van der Walt Date: Wed, 1 Dec 2010 16:50:00 +0200 Subject: [PATCH] BUG: OpenCV checks shape of memory provided. --- scikits/image/opencv/opencv_cv.pyx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scikits/image/opencv/opencv_cv.pyx b/scikits/image/opencv/opencv_cv.pyx index a834d3f9..94521113 100644 --- a/scikits/image/opencv/opencv_cv.pyx +++ b/scikits/image/opencv/opencv_cv.pyx @@ -2543,7 +2543,10 @@ def cvFindFundamentalMat(points1, points2, int method=CV_FM_RANSAC, cdef np.npy_intp fundamental_shape[2] cdef np.npy_intp status_shape[1] - fundamental_shape[0] = 9 + if (status == CV_FM_7POINT): + fundamental_shape[0] = 9 + else: + fundamental_shape[0] = 3 fundamental_shape[1] = 3 status_shape[0] = points1.shape[0] @@ -2578,7 +2581,7 @@ def cvFindFundamentalMat(points1, points2, int method=CV_FM_RANSAC, if m == 0: return (None, status) else: - return (F[:m, :].reshape((m, 3, 3)), shape) + return (F.reshape((m, 3, 3)), status) #------------------------