def test_point_alignment_without_normalization(self):
        image = np.random.randint(0, 255, (40, 40, 3)).astype(np.uint8)

        point_aligner = PointAligner({'type': 'point_alignment', 'dst_width': 40, 'dst_height': 40, 'normalize': False})
        result = point_aligner(
            DataRepresentation(image), {'keypoints': PointAligner.ref_landmarks.reshape(-1).tolist()}
        ).data
        transformation_matrix = point_aligner.transformation_from_points(
            point_aligner.ref_landmarks * 40, point_aligner.ref_landmarks * 40
        )
        expected_result = cv2.warpAffine(image, transformation_matrix, (40, 40), flags=cv2.WARP_INVERSE_MAP)

        assert np.array_equal(result, expected_result)
    def test_point_alignment_with_drawing_points(self):
        image = np.random.randint(0, 255, (40, 40, 3)).astype(np.uint8)

        point_aligner = PointAligner({
            'type': 'point_alignment', 'dst_width': 40, 'dst_height': 40, 'draw_points': True
        })
        result = point_aligner(
            DataRepresentation(image), {'keypoints': PointAligner.ref_landmarks.reshape(-1).tolist()}
        ).data
        transformation_matrix = point_aligner.transformation_from_points(
            point_aligner.ref_landmarks * 40, point_aligner.ref_landmarks
        )
        expected_result = image
        for point in PointAligner.ref_landmarks:
            cv2.circle(expected_result, (int(point[0]), int(point[1])), 5, (255, 0, 0), -1)
        expected_result = cv2.warpAffine(expected_result, transformation_matrix, (40, 40), flags=cv2.WARP_INVERSE_MAP)

        assert np.array_equal(result, expected_result)