개정판 2052480a
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