From 31e1edfb57c6b27744aaf2438e6214e3099de734 Mon Sep 17 00:00:00 2001 From: Stefan van der Walt Date: Thu, 2 Dec 2010 13:48:27 +0200 Subject: [PATCH] ENH: Add test for cvUndistort2 with new intrinsics provided. --- scikits/image/opencv/tests/test_opencv_cv.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/scikits/image/opencv/tests/test_opencv_cv.py b/scikits/image/opencv/tests/test_opencv_cv.py index f09fbf99..681539d6 100644 --- a/scikits/image/opencv/tests/test_opencv_cv.py +++ b/scikits/image/opencv/tests/test_opencv_cv.py @@ -304,6 +304,21 @@ class TestUndistort2(OpenCVTest): assert_array_almost_equal(undist, self.lena_RGB_U8) assert_array_almost_equal(undistg, self.lena_GRAY_U8) + @opencv_skip + def test_cvUndistort2_new_intrinsics(self): + intrinsics = np.array([[1, 0, 0], + [0, 1, 0], + [0, 0, 1]], dtype='float64') + distortions = np.array([0., 0., 0., 0., 0.], dtype='float64') + + undist = cvUndistort2(self.lena_RGB_U8, intrinsics, distortions, + intrinsics) + undistg = cvUndistort2(self.lena_GRAY_U8, intrinsics, distortions, + intrinsics) + + assert_array_almost_equal(undist, self.lena_RGB_U8) + assert_array_almost_equal(undistg, self.lena_GRAY_U8) +