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

我没有找到任何非Windows系统的pytesseract替代包装。我想在不使用Pandas Dataframe中的pytesseract的情况下提取带有坐标的文本。

nidi_1 回答:使用tesseract python提取文本坐标而不使用pytesseract

tesseract_path是将tesseract安装在Windows系统中的路径。

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

tsv_path是文件的输出路径,其中提取的信息存储在该文件中,例如../ 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

本文链接:https://www.f2er.com/3167613.html

大家都在问