如何在pytesseract中获得字符位置 [英] how to get character position in pytesseract

查看:840
本文介绍了如何在pytesseract中获得字符位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用pytesseract库获取图像文件的字符位置。

I am trying to get character position of image files using pytesseract library .

import pytesseract
from PIL import Image
print pytesseract.image_to_string(Image.open('5.png'))

是否有任何库来获取角色的每个位置

Is there any library for getting each position of character

推荐答案

使用pytesseract看起来不是最好的想法,但是你可以这样做:

Using pytesseract doesn't seem the best idea to have the position but you can do this :

from pytesseract import pytesseract
pytesseract.run_tesseract('image.png', 'output', lang=None, boxes=False, config="hocr")

这篇关于如何在pytesseract中获得字符位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆