Example #1
0
    def ISample(self):

        title = self.title

        target_word = 'Trainingkeyword'

        segmentation_threshold = self.segmentation_threshold

        kernel_dilate_reg = self.kernel_dilate_reg

        scale = self.scale

        img, window_position = Image_Capture(title).ICapture()

        thresh_seg, thresh_ocr = Image_Process(
            img, segmentation_threshold).IProcess()

        group_coordinates = Image_Analyze(thresh_seg, kernel_dilate_reg,
                                          scale).IBoundary(thresh_ocr)

        Image = Image_OCR(thresh_ocr, window_position, group_coordinates,
                          target_word)

        if os.path.isdir('Sample\\' + title):

            shutil.rmtree('Sample\\' + title)

        os.makedirs('Sample\\' + title)

        for i in range(len(group_coordinates)):

            for j in range(len(group_coordinates[i])):

                Image.IOCR(group_coordinates[i][j],
                           training_flag=True,
                           save_path=title)