프로젝트

일반

사용자정보

개정판 2052480a

ID2052480a5d65633b95e099bb682ade235242536c
상위 7f716741
하위 3239bb0a

함의성이(가) 약 5년 전에 추가함

issue #655: fix text training default box gen

Change-Id: I2b5b27561293e760dbf0b898c06308ececdba26a

차이점 보기:

DTI_PID/DTI_PID/TrainingImageListDialog.py
665 665
                docData = AppDocData.instance()
666 666
                oCRLang = docData.getCurrentProject().getName() if TOCR.exist_trained_data() else 'eng'
667 667
                whiteCharList = docData.getConfigs('Text Recognition', 'White Character List')
668
                if len(whiteCharList) is 0:
669
                    boundaryOcrData = pytesseract.image_to_boxes(drawing, config=TOCR.DEFAULT_CONF, lang=oCRLang)
670
                else:
671
                    boundaryOcrData = pytesseract.image_to_boxes(drawing,
672
                                                                 config=TOCR.DEFAULT_CONF_COMM + whiteCharList[0].value,
673
                                                                 lang=oCRLang)
668

  
669
                configs = docData.getConfigs('Text Recognition', 'Page Segmentation Modes')
670
                _conf = TOCR.DEFAULT_CONF_COMM.format(configs[0].value if configs else '3')
671

  
672
                if len(whiteCharList) is 1:
673
                    _conf += f" -c tessedit_char_whitelist=\"{whiteCharList[0].value}\""
674
                    
675
                boundaryOcrData = pytesseract.image_to_boxes(drawing, config=_conf, lang=oCRLang)
674 676

  
675 677
        except Exception as ex:
676 678
            from App import App

내보내기 Unified diff

클립보드 이미지 추가 (최대 크기: 500 MB)