개정판 3442f8e9
issue #506: fix text area
Change-Id: Ia88b3276c3dac9b883f322fac8f174778b7e67d4
DTI_PID/DTI_PID/tesseract_ocr_module.py | ||
---|---|---|
207 | 207 |
# up to here |
208 | 208 |
if minSize <= rect.height() <= maxSize: # TODO: 이 부분이 필요한가? |
209 | 209 |
if long_img: |
210 |
text_rect = QRect(rect.left() + offset_x - thickness, rect.top() + offset_y - thickness, int(rect.width()/ 3), rect.height())
|
|
210 |
text_rect = QRect(rect.left() + offset_x, rect.top() + offset_y, int(rect.width()/ 3), rect.height())
|
|
211 | 211 |
else: |
212 |
text_rect = QRect(rect.left() - thickness, imgHeight - rect.bottom() - thickness, rect.width(), rect.height())
|
|
213 |
|
|
212 |
text_rect = QRect(rect.left(), imgHeight - rect.bottom(), rect.width(), rect.height())
|
|
213 |
|
|
214 | 214 |
if text_rect.width() < 5 or text_rect.height() < 5: |
215 | 215 |
continue |
216 | 216 |
if angle == 90 or angle == 270: |
... | ... | |
220 | 220 |
transform.translate(-imgWidth * 0.5, -imgHeight * 0.5) |
221 | 221 |
text_rect = transform.mapRect(text_rect) |
222 | 222 |
|
223 |
text_info = ti.TextInfo(text_filter(text), startPoint[0] + text_rect.left(), |
|
224 |
startPoint[1] + text_rect.top(), |
|
223 |
text_info = ti.TextInfo(text_filter(text), startPoint[0] + text_rect.left() - thickness,
|
|
224 |
startPoint[1] + text_rect.top() - thickness,
|
|
225 | 225 |
text_rect.width(), text_rect.height(), angle) |
226 | 226 |
textInfoList.append(text_info) |
227 | 227 |
|
내보내기 Unified diff