개정판 c6716264
gcloud test
Change-Id: Ic62ad4e3bc2161ba72aabf98f0612c097363858a
DTI_PID/DTI_PID/TextDetector.py | ||
---|---|---|
339 | 339 |
_textImg = imgGray[top:bottom, left:right] |
340 | 340 |
textImg = _textImg.copy() |
341 | 341 |
|
342 |
text._img = textImg |
|
342 | 343 |
text._canvas = None |
343 | 344 |
|
344 | 345 |
if textImg.shape[0] != text.getH() or textImg.shape[1] != text.getW(): |
... | ... | |
391 | 392 |
string = string + img_info[0] |
392 | 393 |
|
393 | 394 |
if string: |
394 |
res_list.append(ti.TextInfo(string, text.getX(), text.getY(), text.getW(), text.getH(), text.getAngle())) |
|
395 |
indices = np.where(text._img == [0]) |
|
396 |
minx, maxx = min(indices[1]), max(indices[1]) |
|
397 |
miny, maxy = min(indices[0]), max(indices[0]) |
|
398 |
res_list.append(ti.TextInfo(string, text.getX() + minx, text.getY() + miny, maxx - minx, maxy - miny, text.getAngle())) |
|
395 | 399 |
|
396 | 400 |
except Exception as ex: |
397 | 401 |
message = 'error occurred({}) in {}:{}'.format(repr(ex), sys.exc_info()[-1].tb_frame.f_code.co_filename, |
... | ... | |
512 | 516 |
configs = app_doc_data.getConfigs('Text Recognition', 'Merge Size') |
513 | 517 |
mergeSize = int(configs[0].value) if 1 == len(configs) else 10 |
514 | 518 |
#gap_size = mergeSize / 2 |
515 |
gap_size = 4
|
|
519 |
gap_size = 3
|
|
516 | 520 |
|
517 | 521 |
verticals = [] |
518 | 522 |
horizontals = [] |
내보내기 Unified diff