diff --git a/scikits/image/data/chessboard_GRAY_U8.npz b/scikits/image/data/chessboard_GRAY_U8.npz new file mode 100644 index 00000000..5ec77921 Binary files /dev/null and b/scikits/image/data/chessboard_GRAY_U8.npz differ diff --git a/scikits/image/data/chessboard_RGB_U8.npz b/scikits/image/data/chessboard_RGB_U8.npz new file mode 100644 index 00000000..188f42b4 Binary files /dev/null and b/scikits/image/data/chessboard_RGB_U8.npz differ diff --git a/scikits/image/data/cvCalibrateCamera2TestData.npz b/scikits/image/data/cvCalibrateCamera2TestData.npz new file mode 100644 index 00000000..effe2842 Binary files /dev/null and b/scikits/image/data/cvCalibrateCamera2TestData.npz differ diff --git a/scikits/image/data/cvCalibrateCamera2TestData.pck b/scikits/image/data/cvCalibrateCamera2TestData.pck deleted file mode 100644 index f728ce43..00000000 Binary files a/scikits/image/data/cvCalibrateCamera2TestData.pck and /dev/null differ diff --git a/scikits/image/data/diamond-bothat-matlab-output.npy b/scikits/image/data/diamond-bothat-matlab-output.npy deleted file mode 100644 index 9dea4c83..00000000 Binary files a/scikits/image/data/diamond-bothat-matlab-output.npy and /dev/null differ diff --git a/scikits/image/data/diamond-bothat-matlab-output.npz b/scikits/image/data/diamond-bothat-matlab-output.npz new file mode 100644 index 00000000..1b0a65dd Binary files /dev/null and b/scikits/image/data/diamond-bothat-matlab-output.npz differ diff --git a/scikits/image/data/diamond-close-matlab-output.npy b/scikits/image/data/diamond-close-matlab-output.npy deleted file mode 100644 index 75ce1fdb..00000000 Binary files a/scikits/image/data/diamond-close-matlab-output.npy and /dev/null differ diff --git a/scikits/image/data/diamond-close-matlab-output.npz b/scikits/image/data/diamond-close-matlab-output.npz new file mode 100644 index 00000000..4f39c48c Binary files /dev/null and b/scikits/image/data/diamond-close-matlab-output.npz differ diff --git a/scikits/image/data/diamond-dilate-matlab-output.npy b/scikits/image/data/diamond-dilate-matlab-output.npy deleted file mode 100644 index 035de9b6..00000000 Binary files a/scikits/image/data/diamond-dilate-matlab-output.npy and /dev/null differ diff --git a/scikits/image/data/diamond-dilate-matlab-output.npz b/scikits/image/data/diamond-dilate-matlab-output.npz new file mode 100644 index 00000000..f79d9a44 Binary files /dev/null and b/scikits/image/data/diamond-dilate-matlab-output.npz differ diff --git a/scikits/image/data/diamond-erode-matlab-output.npy b/scikits/image/data/diamond-erode-matlab-output.npy deleted file mode 100644 index 8ba96637..00000000 Binary files a/scikits/image/data/diamond-erode-matlab-output.npy and /dev/null differ diff --git a/scikits/image/data/diamond-erode-matlab-output.npz b/scikits/image/data/diamond-erode-matlab-output.npz new file mode 100644 index 00000000..3b034cb4 Binary files /dev/null and b/scikits/image/data/diamond-erode-matlab-output.npz differ diff --git a/scikits/image/data/diamond-matlab-output.npy b/scikits/image/data/diamond-matlab-output.npy deleted file mode 100644 index bfb2030e..00000000 Binary files a/scikits/image/data/diamond-matlab-output.npy and /dev/null differ diff --git a/scikits/image/data/diamond-matlab-output.npz b/scikits/image/data/diamond-matlab-output.npz new file mode 100644 index 00000000..e59caa70 Binary files /dev/null and b/scikits/image/data/diamond-matlab-output.npz differ diff --git a/scikits/image/data/diamond-open-matlab-output.npy b/scikits/image/data/diamond-open-matlab-output.npy deleted file mode 100644 index a3f7b0f9..00000000 Binary files a/scikits/image/data/diamond-open-matlab-output.npy and /dev/null differ diff --git a/scikits/image/data/diamond-open-matlab-output.npz b/scikits/image/data/diamond-open-matlab-output.npz new file mode 100644 index 00000000..143fcd4d Binary files /dev/null and b/scikits/image/data/diamond-open-matlab-output.npz differ diff --git a/scikits/image/data/diamond-tophat-matlab-output.npy b/scikits/image/data/diamond-tophat-matlab-output.npy deleted file mode 100644 index 03ce6bbc..00000000 Binary files a/scikits/image/data/diamond-tophat-matlab-output.npy and /dev/null differ diff --git a/scikits/image/data/diamond-tophat-matlab-output.npz b/scikits/image/data/diamond-tophat-matlab-output.npz new file mode 100644 index 00000000..eb5cd8c1 Binary files /dev/null and b/scikits/image/data/diamond-tophat-matlab-output.npz differ diff --git a/scikits/image/data/disk-bothat-matlab-output.npy b/scikits/image/data/disk-bothat-matlab-output.npy deleted file mode 100644 index 3f6d1669..00000000 Binary files a/scikits/image/data/disk-bothat-matlab-output.npy and /dev/null differ diff --git a/scikits/image/data/disk-bothat-matlab-output.npz b/scikits/image/data/disk-bothat-matlab-output.npz new file mode 100644 index 00000000..352a8d76 Binary files /dev/null and b/scikits/image/data/disk-bothat-matlab-output.npz differ diff --git a/scikits/image/data/disk-close-matlab-output.npy b/scikits/image/data/disk-close-matlab-output.npy deleted file mode 100644 index e326ad33..00000000 Binary files a/scikits/image/data/disk-close-matlab-output.npy and /dev/null differ diff --git a/scikits/image/data/disk-close-matlab-output.npz b/scikits/image/data/disk-close-matlab-output.npz new file mode 100644 index 00000000..2e76e8e6 Binary files /dev/null and b/scikits/image/data/disk-close-matlab-output.npz differ diff --git a/scikits/image/data/disk-dilate-matlab-output.npy b/scikits/image/data/disk-dilate-matlab-output.npy deleted file mode 100644 index d60973e1..00000000 Binary files a/scikits/image/data/disk-dilate-matlab-output.npy and /dev/null differ diff --git a/scikits/image/data/disk-dilate-matlab-output.npz b/scikits/image/data/disk-dilate-matlab-output.npz new file mode 100644 index 00000000..9b7a5577 Binary files /dev/null and b/scikits/image/data/disk-dilate-matlab-output.npz differ diff --git a/scikits/image/data/disk-erode-matlab-output.npy b/scikits/image/data/disk-erode-matlab-output.npy deleted file mode 100644 index 03e031f9..00000000 Binary files a/scikits/image/data/disk-erode-matlab-output.npy and /dev/null differ diff --git a/scikits/image/data/disk-erode-matlab-output.npz b/scikits/image/data/disk-erode-matlab-output.npz new file mode 100644 index 00000000..43c6606d Binary files /dev/null and b/scikits/image/data/disk-erode-matlab-output.npz differ diff --git a/scikits/image/data/disk-matlab-output.npy b/scikits/image/data/disk-matlab-output.npy deleted file mode 100644 index ba00ed00..00000000 Binary files a/scikits/image/data/disk-matlab-output.npy and /dev/null differ diff --git a/scikits/image/data/disk-matlab-output.npz b/scikits/image/data/disk-matlab-output.npz new file mode 100644 index 00000000..5ea8f5ba Binary files /dev/null and b/scikits/image/data/disk-matlab-output.npz differ diff --git a/scikits/image/data/disk-open-matlab-output.npy b/scikits/image/data/disk-open-matlab-output.npy deleted file mode 100644 index 97ef778b..00000000 Binary files a/scikits/image/data/disk-open-matlab-output.npy and /dev/null differ diff --git a/scikits/image/data/disk-open-matlab-output.npz b/scikits/image/data/disk-open-matlab-output.npz new file mode 100644 index 00000000..fcfc652f Binary files /dev/null and b/scikits/image/data/disk-open-matlab-output.npz differ diff --git a/scikits/image/data/disk-tophat-matlab-output.npy b/scikits/image/data/disk-tophat-matlab-output.npy deleted file mode 100644 index 2cab1cb6..00000000 Binary files a/scikits/image/data/disk-tophat-matlab-output.npy and /dev/null differ diff --git a/scikits/image/data/disk-tophat-matlab-output.npz b/scikits/image/data/disk-tophat-matlab-output.npz new file mode 100644 index 00000000..1e104c2e Binary files /dev/null and b/scikits/image/data/disk-tophat-matlab-output.npz differ diff --git a/scikits/image/data/lena_GRAY_U8.npz b/scikits/image/data/lena_GRAY_U8.npz new file mode 100644 index 00000000..b3ca94c6 Binary files /dev/null and b/scikits/image/data/lena_GRAY_U8.npz differ diff --git a/scikits/image/data/lena_RGB_U8.npz b/scikits/image/data/lena_RGB_U8.npz new file mode 100644 index 00000000..d822fd93 Binary files /dev/null and b/scikits/image/data/lena_RGB_U8.npz differ diff --git a/scikits/image/morphology/tests/test_morphology.py b/scikits/image/morphology/tests/test_morphology.py index 5bde664b..ff22c458 100644 --- a/scikits/image/morphology/tests/test_morphology.py +++ b/scikits/image/morphology/tests/test_morphology.py @@ -15,48 +15,49 @@ class TestMorphology(): def morph_worker(self, img, fn, morph_func, strel_func): matlab_results = np.load(os.path.join(data_dir, fn)) k = 0 - for expected_result in matlab_results: + for arrname in sorted(matlab_results): + expected_result = matlab_results[arrname] mask = strel_func(k) actual_result = morph_func(lena, mask) assert_equal(expected_result, actual_result) k = k + 1 def test_erode_diamond(self): - self.morph_worker(lena, "diamond-erode-matlab-output.npy", + self.morph_worker(lena, "diamond-erode-matlab-output.npz", greyscale_erode, diamond) def test_dilate_diamond(self): - self.morph_worker(lena, "diamond-dilate-matlab-output.npy", + self.morph_worker(lena, "diamond-dilate-matlab-output.npz", greyscale_dilate, diamond) def test_open_diamond(self): - self.morph_worker(lena, "diamond-open-matlab-output.npy", + self.morph_worker(lena, "diamond-open-matlab-output.npz", greyscale_open, diamond) def test_close_diamond(self): - self.morph_worker(lena, "diamond-close-matlab-output.npy", + self.morph_worker(lena, "diamond-close-matlab-output.npz", greyscale_close, diamond) def test_tophat_diamond(self): - self.morph_worker(lena, "diamond-tophat-matlab-output.npy", + self.morph_worker(lena, "diamond-tophat-matlab-output.npz", greyscale_white_top_hat, diamond) def test_bothat_diamond(self): - self.morph_worker(lena, "diamond-bothat-matlab-output.npy", + self.morph_worker(lena, "diamond-bothat-matlab-output.npz", greyscale_black_top_hat, diamond) def test_erode_disk(self): - self.morph_worker(lena, "disk-erode-matlab-output.npy", + self.morph_worker(lena, "disk-erode-matlab-output.npz", greyscale_erode, disk) def test_dilate_disk(self): - self.morph_worker(lena, "disk-dilate-matlab-output.npy", + self.morph_worker(lena, "disk-dilate-matlab-output.npz", greyscale_dilate, disk) def test_open_disk(self): - self.morph_worker(lena, "disk-open-matlab-output.npy", + self.morph_worker(lena, "disk-open-matlab-output.npz", greyscale_open, disk) def test_close_disk(self): - self.morph_worker(lena, "disk-close-matlab-output.npy", + self.morph_worker(lena, "disk-close-matlab-output.npz", greyscale_close, disk) diff --git a/scikits/image/morphology/tests/test_selem.py b/scikits/image/morphology/tests/test_selem.py index 8ff93180..8f2d8d47 100644 --- a/scikits/image/morphology/tests/test_selem.py +++ b/scikits/image/morphology/tests/test_selem.py @@ -28,7 +28,8 @@ class TestSElem(): def strel_worker(self, fn, func): matlab_masks = np.load(os.path.join(data_dir, fn)) k = 0 - for expected_mask in matlab_masks: + for arrname in sorted(matlab_masks): + expected_mask = matlab_masks[arrname] actual_mask = func(k) if (expected_mask.shape == (1,)): expected_mask = expected_mask[:,np.newaxis] @@ -36,8 +37,8 @@ class TestSElem(): k = k + 1 def test_selem_disk(self): - self.strel_worker("disk-matlab-output.npy", selem.disk) + self.strel_worker("disk-matlab-output.npz", selem.disk) def test_selem_diamond(self): - self.strel_worker("diamond-matlab-output.npy", selem.diamond) + self.strel_worker("diamond-matlab-output.npz", selem.diamond) diff --git a/scikits/image/opencv/tests/test_opencv_cv.py b/scikits/image/opencv/tests/test_opencv_cv.py index ecccbfa5..b798b6a4 100644 --- a/scikits/image/opencv/tests/test_opencv_cv.py +++ b/scikits/image/opencv/tests/test_opencv_cv.py @@ -23,8 +23,8 @@ with warnings.catch_warnings(): opencv_skip = dec.skipif(not loaded, 'OpenCV libraries not found') class OpenCVTest(object): - lena_RGB_U8 = np.load(os.path.join(data_dir, 'lena_RGB_U8.npy')) - lena_GRAY_U8 = np.load(os.path.join(data_dir, 'lena_GRAY_U8.npy')) + lena_RGB_U8 = np.load(os.path.join(data_dir, 'lena_RGB_U8.npz'))['arr_0'] + lena_GRAY_U8 = np.load(os.path.join(data_dir, 'lena_GRAY_U8.npz'))['arr_0'] class TestSobel(OpenCVTest): @@ -239,18 +239,18 @@ class TestPyrUp(OpenCVTest): class TestFindChessboardCorners(object): @opencv_skip def test_cvFindChessboardCorners(self): - chessboard_GRAY_U8 = np.load(os.path.join(data_dir, - 'chessboard_GRAY_U8.npy')) + chessboard_GRAY_U8 = np.load( + os.path.join(data_dir, 'chessboard_GRAY_U8.npz')['arr_0']) pts = cvFindChessboardCorners(chessboard_GRAY_U8, (7, 7)) class TestDrawChessboardCorners(object): @opencv_skip def test_cvDrawChessboardCorners(self): - chessboard_GRAY_U8 = np.load(os.path.join(data_dir, - 'chessboard_GRAY_U8.npy')) - chessboard_RGB_U8 = np.load(os.path.join(data_dir, - 'chessboard_RGB_U8.npy')) + chessboard_GRAY_U8 = np.load( + os.path.join(data_dir, 'chessboard_GRAY_U8.npz')['arr_0']) + chessboard_RGB_U8 = np.load( + os.path.join(data_dir, 'chessboard_RGB_U8.npz')['arr_0']) corners = cvFindChessboardCorners(chessboard_GRAY_U8, (7, 7)) cvDrawChessboardCorners(chessboard_RGB_U8, (7, 7), corners) @@ -285,10 +285,8 @@ class TestCalibrateCamera2(object): @opencv_skip @dec.slow def test_cvCalibrateCamera2_KnownData(self): - (object_points,points_count,image_points,intrinsics,distortions) =\ - cPickle.load(open(os.path.join( - data_dir, "cvCalibrateCamera2TestData.pck"), "rb") - ) + _, (object_points,points_count,image_points,intrinsics,distortions) = \ + np.load(os.path.join(data_dir, "cvCalibrateCamera2TestData.npz")) intrinsics_test, distortion_test = cvCalibrateCamera2( object_points, image_points, points_count, (1024,1280)