如果使用配置tessedit_char_whitelist,则pyteseract image_to_data信心结果无法正常工作
我使用的是Pytesseract 5.0.1.20220118,带有Python 3.9.7,需要从具有某些白色列表条件的车牌中检测文本,并获得每个检测的信心:
pt.image_to_data(roi,lang ='eng', config="--psm 6", output_type='data.frame')
在此图像上:
[]
我将获得以下输出:
conf文本
-1.000000 nan
-1.000000 nan
-1.000000 nan
-1.000000 nan
92.998444 b
95.961960 708569
96.753922 |
但是,“ |”角色不是允许的角色,所以我添加了一个白名单:
pt.image_to_data(roi,lang ='eng', config="--psm 6 -c tessedit_char_whitelist=0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ", output_type='data.frame')
我得到了:
conf文本
-1.0 nan
-1.0 nan
-1.0 nan
-1.0 nan
0.0 B708569]
但是现在检测的信心是错误的。我该如何解决?
I am using pytesseract 5.0.1.20220118 with python 3.9.7 and need to detect text from a license plate with certain white list conditions and get the confidence for each detection:
pt.image_to_data(roi,lang ='eng', config="--psm 6", output_type='data.frame')
On this image:
[]
I get the following output:
conf text
-1.000000 NaN
-1.000000 NaN
-1.000000 NaN
-1.000000 NaN
92.998444 B
95.961960 708569
96.753922 |
However, the "|" character is not an allowed character so I added a whitelist:
pt.image_to_data(roi,lang ='eng', config="--psm 6 -c tessedit_char_whitelist=0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ", output_type='data.frame')
And I got:
conf text
-1.0 NaN
-1.0 NaN
-1.0 NaN
-1.0 NaN
0.0 B708569]
But now the confidence of the detections is wrong. How can I fix this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论