【问题标题】:Extracting coordinates of text using tesseract python without using pytesseract使用tesseract python提取文本坐标而不使用pytesseract
【发布时间】:2019-11-04 10:16:01
【问题描述】:

我没有找到任何不适用于 Windows 系统的 pytesseract 替代包装器。我想在熊猫数据框中不使用 pytesseract 来提取带有坐标的文本。

【问题讨论】:

    标签: python pandas text ocr tesseract


    【解决方案1】:

    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

    【讨论】:

      猜你喜欢
      • 2019-06-24
      • 1970-01-01
      • 1970-01-01
      • 2018-09-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-07-07
      • 2013-09-04
      相关资源
      最近更新 更多