def distort(self, board_image):
     l = board_image.shape[0]
     line_image = convert_svg_text_to_png(
         ARROW_CHESS_LINE %
         (self.x1 * l, self.y1 * l, self.x2 * l, self.y2 * l), l, l)
     board_image = overlay_image(board_image, line_image, 0, 0)
     return board_image
Beispiel #2
0
 def distort(self, image_overlay):
     l = image_overlay.original_length
     circle_radius = l * 4 / 9
     png_image = convert_svg_text_to_png(CIRCLE % (0, 0, circle_radius), l,
                                         l)
     image_overlay.absolute_images.append(png_image)
     return image_overlay
    def distort(self, board_image):

        l = board_image.shape[0]
        cv2.line(board_image,
                 (int(l * self.x1 + l / 2), int(l * self.y1 + l / 2)),
                 (int(l * self.linex + l / 2), int(l * self.liney + l / 2)),
                 (0, 168, 255), 19)

        line_image = convert_svg_text_to_png(
            ARROW_CHESS_LINE %
            (self.linex * l, self.liney * l, self.x2 * l, self.y2 * l), l, l)
        board_image = overlay_image(board_image, line_image, 0, 0)
        return board_image