python - pytesseract 无法处理数字图像
问题描述
我想使用 pytesseract 对以下图像进行分类:
但它将其归类为“T”。
这是代码:
txt = pytesseract.image_to_string(image, config='-psm 10')
解决方案
image = cv2.imread('image.jpg', cv2.IMREAD_UNCHANGED);
image = cv2.bitwise_not(image)
text = pytesseract.image_to_string(image, lang='eng',config='--tessdata-dir "/tessdata/data/" --oem 2 --psm 6')
print(text)
推荐阅读
- html - 容器不会相互对齐。改变宽度会导致不良结果
- asp.net-core - RDLC 报告索引超出了数组 asp net core 的范围
- c# - 区分对象列表的列表
- android - 我看不到我的 Firebase 实时数据库
- reactjs - 为什么我会收到此错误 - 1622767296:客户端 clientId 上的套接字错误,正在断开连接。?
- python - 在关键字后读取多行?
- javascript - 如何在 if 语句中处理变量时忽略大小写 - Javascript
- javascript - Reactjs 自定义钩子不会在 useEffect 中使用 if/else 触发?
- r - 如何在 R Shiny 应用程序中创建具有两个反应值的堆积百分比条形图?
- java - 如何从两个表中获取数据的回收视图?