개정판 ce628cea
issue #1124: impove title block, added default text and multi-line text
Change-Id: Ibbc0d3ca4587631bbb2ade0167199ca132311edd
DTI_PID/DTI_PID/TextDetector.py | ||
---|---|---|
331 | 331 |
for titleBlockProp in titleBlockProps: |
332 | 332 |
area = Area(titleBlockProp[0]) |
333 | 333 |
area.parse(titleBlockProp[2]) |
334 |
img = imgSrc[round(area.y):round(area.y+area.height), round(area.x):round(area.x+area.width)] |
|
335 |
if len(whiteCharList) is 0: |
|
336 |
texts = TOCR.getTextInfo(img, (area.x, area.y), 0, language=appDocData.OCRData) |
|
334 |
if not (titleBlockProp[3] and titleBlockProp[3] != ''): |
|
335 |
img = imgSrc[round(area.y):round(area.y+area.height), round(area.x):round(area.x+area.width)] |
|
336 |
if len(whiteCharList) is 0: |
|
337 |
texts = TOCR.getTextInfo(img, (area.x, area.y), 0, language=appDocData.OCRData) |
|
338 |
else: |
|
339 |
texts = TOCR.getTextInfo(img, (area.x, area.y), 0, language='eng', conf=whiteCharList[0].value) |
|
340 |
texts = [ti.TextInfo('\n'.join([textInfo.getText() for textInfo in texts]), area.x, area.y, area.width, area.height, 0)] |
|
337 | 341 |
else: |
338 |
texts = TOCR.getTextInfo(img, (area.x, area.y), 0, language='eng', conf=whiteCharList[0].value)
|
|
342 |
texts = [ti.TextInfo(titleBlockProp[3], area.x, area.y, area.width, area.height, 0)]
|
|
339 | 343 |
self.titleBlockTextInfoList.append([area.name, texts]) |
340 | 344 |
|
341 | 345 |
if worker is not None: worker.updateProgress.emit(maxProgressValue, None) |
내보내기 Unified diff