def test_centre(self):
# Request new centre below current centre
new_centre = (100, 100)
# Load image for testing.
image = cv2.imread(os.path.join(self.path_to_test_data, 'pad_test_input.png'))
image = cv2.resize(image, (200, 200))
# Check image was loaded correctly
if image is None:
raise TypeError
# Pad Image.
modified_image = camera_utils.pad_image(image, new_centre)
# Compare images
self.assertTrue(not (np.bitwise_xor(modified_image, image).any()))
评论列表
文章目录