繁体   English   中英

使用tesseract python 提取文本坐标而不使用pytesseract

[英]Extracting coordinates of text using tesseract python without using pytesseract

我没有找到任何不适用于 windows 系统的 pytesseract 替代包装器。 我想在 pandas dataframe 中使用 pytesseract 提取文本及其坐标。

tesseract_path 是您的 tesseract 在 windows 系统中安装的路径。

img_path 是我们要从中提取文本的图像的路径。

tsv_path 是存储提取信息的文件的 output 路径,例如 ../path/sample_output

import os

tesseract_cmd = '"%s" %s %s -l eng --psm 6 tsv'%(tesseract_path, img_path, tsv_path)

os.system('cmd /c %s'%(tesseract_cmd))
import pandas as pd

df = pd.read_csv('%s.tsv'%(tsv_path), sep='\t', header=0)

参考: https://github.com/tesseract-ocr/tesseract/wiki/Command-Line-Usage

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM