You need to enable JavaScript to run this app. Tesseract指定脚本语言时需输入script路径是否为预期行为
优惠活动
大模型
产品
解决方案
定价
更多

Tesseract指定脚本语言时需输入script路径是否为预期行为

问题场景
  • Tesseract 4.0.0版本在原有语言文件体系中新增了脚本类识别文件,这类文件统一存放于tessdata/script目录下。
  • 参照官方手册说明,-l参数支持输入语言名称或脚本名称作为识别目标。
  • 原本的使用预期是:程序优先在tessdata根目录查找对应文件,若未找到则自动跳转至tessdata/script目录完成检索。
实际表现差异
  • 直接输入脚本名称执行识别命令时会报错:
    c:\Users\>tesseract -l Latin c:\TestFiles\english-sentence.jpg stdout
    Error opening data file c:\Program Files\tesseract-OCR/tessdata/Latin.traineddata
    Please make sure the TESSDATA_PREFIX environment variable is set to your "tessdata" directory.
    Failed loading language 'Latin'
    Tesseract couldn't load any languages!
    Could not initialize tesseract.
    
  • 输入带完整子目录前缀的脚本参数时,程序可正常完成识别:
    c:\Users\>tesseract -l script/Latin c:\TestFiles\english-sentence.jpg stdout
    my house has a tree in the front and a car in the
    back
    
环境验证信息
  • 执行tesseract --list-langs命令的输出可以确认,程序本身已经正常识别到了script子目录下的脚本类文件,输出片段如下:
    por
    pus
    que
    ron
    rus
    san
    script/Arabic
    script/Armenian
    script/Bengali
    script/Canadian_Aboriginal
    

内容的提问来源于stack exchange,提问作者Peter Kronenberg

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.11.05 23:45:02