コード例 #1
0
    def generate_test_dataset(self):
        """
        Funkcja użyta raz do wygenerowania obrazów testowych, które są używane jako obrazy z domyślnej lokalizacji.
        Użyta klasa pomocnicza ImageGenerator()
        :param self:
        :return:
        """
        ig = ImageGenerator()

        return [
            self.get_meta_data_from_image(ig.draw_circle(512, 100, ColorRGB.BLACK, 1), 'Kolo'),
            self.get_meta_data_from_image(ig.draw_rectangle(300, 200, 20, ColorRGB.BLACK, 4), 'Prostokat'),
            self.get_meta_data_from_image(ig.draw_square(200, 20, ColorRGB.GREEN, 3), 'Kwadrat'),
            self.get_meta_data_from_image(ig.draw_ellipse(256, (130, 30), 0, ColorRGB.BLUE, 3), 'Elipsa'),
            self.get_meta_data_from_image(ig.draw_square(512, 20, ColorRGB.GREEN, 3), 'Kwadrat'),
            self.get_meta_data_from_image(ig.draw_right_triangle(550, 20, ColorRGB.BLACK, 1), 'Trojkat'),
            self.get_meta_data_from_image(ig.draw_square(256, 20, ColorRGB.GREEN, 3), 'Kwadrat'),
            self.get_meta_data_from_image(ig.draw_circle(256, 120, ColorRGB.BLACK, 1), 'Kolo'),
            self.get_meta_data_from_image(ig.draw_right_triangle(200, 20, ColorRGB.BLACK, 1), 'Trojkat'),
            self.get_meta_data_from_image(ig.draw_rectangle(220, 210, 20, ColorRGB.BLACK, 4), 'Prostokat'),
            self.get_meta_data_from_image(ig.draw_rectangle(250, 300, 20, ColorRGB.BLACK, 4), 'Prostokat'),
            self.get_meta_data_from_image(ig.draw_ellipse(256, (60, 120), 0, ColorRGB.BLUE, 3), 'Elipsa'),
            self.get_meta_data_from_image(ig.draw_circle(256, 70, ColorRGB.RED, 2), 'Kolo'),
            self.get_meta_data_from_image(ig.draw_ellipse(256, (30, 110), 20, ColorRGB.BLUE, 3), 'Elipsa'),
            self.get_meta_data_from_image(ig.draw_right_triangle(300, 20, ColorRGB.GREEN, 1), 'Trojkat'),
        ]
コード例 #2
0
    def generate_training_dataset(self):
        """
        Generuje obrazy w locie na podstawie parametrów przekazanych do funkci opencv.
        Użyta klasa pomocnicza ImageGenerator()
        :return:
        """
        ig = ImageGenerator()

        return [
            self.get_meta_data_from_image(ig.draw_square(456, 20, ColorRGB.GREEN, 3), 'Kwadrat'),
            self.get_meta_data_from_image(ig.draw_square(276, 20, ColorRGB.GREEN, 3), 'Kwadrat'),
            self.get_meta_data_from_image(ig.draw_square(226, 20, ColorRGB.GREEN, 3), 'Kwadrat'),
            self.get_meta_data_from_image(ig.draw_square(356, 20, ColorRGB.GREEN, 3), 'Kwadrat'),
            self.get_meta_data_from_image(ig.draw_rectangle(256, 210, 20, ColorRGB.BLACK, 4), 'Prostokat'),
            self.get_meta_data_from_image(ig.draw_rectangle(205, 220, 20, ColorRGB.BLACK, 4), 'Prostokat'),
            self.get_meta_data_from_image(ig.draw_rectangle(350, 300, 20, ColorRGB.BLACK, 4), 'Prostokat'),
            self.get_meta_data_from_image(ig.draw_circle(256, 60, ColorRGB.RED, 2), 'Kolo'),
            self.get_meta_data_from_image(ig.draw_circle(256, 110, ColorRGB.BLACK, 1), 'Kolo'),
            self.get_meta_data_from_image(ig.draw_circle(256, 110, ColorRGB.BLACK, 1), 'Kolo'),
            self.get_meta_data_from_image(ig.draw_ellipse(256, (60, 100), 20, ColorRGB.BLUE, 3), 'Elipsa'),
            self.get_meta_data_from_image(ig.draw_ellipse(256, (50, 100), 0, ColorRGB.BLUE, 3), 'Elipsa'),
            self.get_meta_data_from_image(ig.draw_ellipse(256, (120, 30), 0, ColorRGB.BLUE, 3), 'Elipsa'),
            self.get_meta_data_from_image(ig.draw_ellipse(256, (120, 30), 0, ColorRGB.BLUE, 3), 'Elipsa'),
            self.get_meta_data_from_image(ig.draw_ellipse(256, (100, 30), 0, ColorRGB.BLUE, 3), 'Elipsa'),
            self.get_meta_data_from_image(ig.draw_ellipse(256, (110, 30), 0, ColorRGB.BLUE, 3), 'Elipsa'),
            self.get_meta_data_from_image(ig.draw_right_triangle(256, 20, ColorRGB.GREEN, 1), 'Trojkat'),
            self.get_meta_data_from_image(ig.draw_right_triangle(512, 20, ColorRGB.BLACK, 1), 'Trojkat'),
            self.get_meta_data_from_image(ig.draw_right_triangle(200, 20, ColorRGB.BLACK, 1), 'Trojkat'),
        ]