From d6f524830ff97f899c86c1120c3deaa96370c81b Mon Sep 17 00:00:00 2001 From: sccolbert Date: Sat, 24 Oct 2009 13:06:52 +0200 Subject: [PATCH] fixed camera calibration to 4-vec for opencv 1 support --- scikits/image/opencv/opencv_cv.pyx | 2 +- scikits/image/opencv/tests/test_opencv_cv.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scikits/image/opencv/opencv_cv.pyx b/scikits/image/opencv/opencv_cv.pyx index c51dee4b..defb817c 100644 --- a/scikits/image/opencv/opencv_cv.pyx +++ b/scikits/image/opencv/opencv_cv.pyx @@ -1054,7 +1054,7 @@ def cvCalibrateCamera2(np.ndarray object_points, np.ndarray image_points, # Allocate a new distortion array cdef np.npy_intp distortion_shape[2] distortion_shape[0] = 1 - distortion_shape[1] = 5 + distortion_shape[1] = 4 cdef np.ndarray distortion = new_array(2, distortion_shape, FLOAT64) cdef IplImage ipl_distortion populate_iplimage(distortion, &ipl_distortion) diff --git a/scikits/image/opencv/tests/test_opencv_cv.py b/scikits/image/opencv/tests/test_opencv_cv.py index 76ff9376..b6a2a068 100644 --- a/scikits/image/opencv/tests/test_opencv_cv.py +++ b/scikits/image/opencv/tests/test_opencv_cv.py @@ -223,7 +223,7 @@ class TestCalibrateCamera2(object): np.array([16, 16, 16], dtype=np.int32), (4, 4) ) - assert_almost_equal(distortions, np.array([0., 0., 0., 0., 0.])) + assert_almost_equal(distortions, np.array([0., 0., 0., 0.,])) # The intrinsics will be strange, but we can at least check # for known zeros and ones assert_almost_equal( intrinsics[0,1], 0)