我有一个结构化表格图像中的数据。数据如下:
我尝试使用以下代码从该图像中提取文本:
import pytesseract
from PIL import Image
value=Image.open("data/pic_table3.png")
text = pytesseract.image_to_string(value, lang="eng")
print(text)
下面是输出:
EA Domains
Traditional role
Future role
Technology e Closed platforms ¢ Open platforms
e Physical e Virtualized Applicationsand |e Proprietary e Inter-organizational Integration e Siloed composite e P2P integrations applications
e EAI technology e Software asa Service
e Enterprise Systems e Service-Oriented
e Automating transactions Architecture
e “Informating”
interactions
但是,预期的数据输出应该根据列和行对齐。我该怎么做?你知道吗
在将图像放入OCR之前,必须对其进行预处理,以删除表格中的线条和点。下面是一个使用OpenCV的方法。你知道吗
这是经过处理的图像:
从脓肿的结果
代码
相关问题 更多 >
编程相关推荐