示例#1
0
    def test_darken(self):
        """
		Tests that the darken augmentation has not changed
		"""
        img = cv2.imread("test_data/augmented/org.png", 3)
        img = aug.brighten_darken(img, 0.6)

        load = cv2.imread("test_data/augmented/darken.png", 3)

        np.testing.assert_array_equal(img, load)
示例#2
0
    def test_augmented_not_same_as_original(self):
        """
		Tests that the augmented images are not the same as the original
		"""
        load = cv2.imread("test_data/augmented/org.png", 3)
        org = cv2.imread("test_data/augmented/org.png", 3)

        #make sure my method of testing is valid
        img = org
        assert np.ndarray.tolist(img) == np.ndarray.tolist(load)

        img = aug.affine_transform(org)
        assert np.ndarray.tolist(img) != np.ndarray.tolist(load)

        img = aug.add_light_and_color_blur(img)
        assert np.ndarray.tolist(img) != np.ndarray.tolist(load)

        img = aug.affine_transform(org)
        assert np.ndarray.tolist(img) != np.ndarray.tolist(load)

        img = aug.brighten_darken(org, 0.6)
        assert np.ndarray.tolist(img) != np.ndarray.tolist(load)

        img = aug.brighten_darken(org, 1.4)
        assert np.ndarray.tolist(img) != np.ndarray.tolist(load)

        img = aug.blur(org)
        assert np.ndarray.tolist(img) != np.ndarray.tolist(load)

        img = aug.sharpen(org)
        assert np.ndarray.tolist(img) != np.ndarray.tolist(load)

        img = aug.rotate(org, -2)
        assert np.ndarray.tolist(img) != np.ndarray.tolist(load)

        img = aug.crop(org, 1, 0, 0, 0)
        assert np.ndarray.tolist(img) != np.ndarray.tolist(load)

        img = aug.mirror(org)
        assert np.ndarray.tolist(img) != np.ndarray.tolist(load)