Skip to main content

tesseract

  • tesseract-ocr/tesseract
    • Apache-2.0, C++
    • Tesseract 主要是为印刷体文本设计的, 有提供手写体识别
    • 2017 4.0 引入 LSTM
    • 2021 5.0 代码优化、指令集加速
    • tessdata 由 Google 维护训练
  • 目前不是最准确的 而是 最通用、最轻量、最容易嵌入
# tesseract-lang -> https://github.com/tesseract-ocr/tessdata_fast/
brew install tesseract

tesseract img.png stdout

# /opt/homebrew/share/tessdata/
# -l eng+chi_sim
tesseract input.jpg -l chi_sim output hocr

  • 输出格式支持
    • text, hOCR (HTML), PDF, invisible-text-only PDF, TSV, ALTO , PAGE
    • ALTO - Analyzed Layout and Text Object XML
  • ./
    • configs
    • eng.traineddata
    • osd.traineddata - Orientation and Script Detection
    • pdf.ttf
      • GlyphLessFont
    • tessconfigs
    • snum.traineddata

tesseract.js