EasyOCR 如何将OCR后的文本写在单行中

iyr7buue  于 5个月前  发布在  其他
关注(0)|答案(2)|浏览(123)
['Reduce your risk of coronavirus infection:', 'Clean hands with soap and water', 'Oralcohol-based hand rub', ' Cover nose and mouth when coughing and', ' sneezing with tissue Or flexed elbow', 'Avoid close contact with anyone with', 'cold or flu-like symptoms', 'Thoroughly cook meat and eggs', 'No unprotected contact with live wild', 'Orfarm animals', 'World Health', 'Organlzation']

合并后的文本内容如下:

Reduce your risk of coronavirus infection: Clean hands with soap and water, Oralcohol-based hand rub Cover nose and mouth when coughing and sneezing with tissue Or flexed elbow Avoid close contact with anyone with cold or flu-like symptoms Thoroughly cook meat and eggs No unprotected contact with live wild Orfarm animals World Health Organlzation
ilmyapht

ilmyapht1#

这应该可以工作

import easyocr
reader = easyocr.Reader(['ch_sim','en'])
A = reader.readtext('english.png')
text = ' '.join([res[1] for res in A])
print(text)
whlutmcx

whlutmcx2#

以下代码可以正常工作:

import easyocr
reader = easyocr.Reader(['ch_sim', 'en'])
A = reader.readtext('english.png', paragraph=True)
print(A)

相关问题