簡體   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