Tess4.0 windows编译与使用

tesseract-OCR4.00 dev VS2015 安装编译

编译教程参考:https://github.com/tesseract-ocr/tesseract/wiki/Compiling#windows

  1. 下载最新的CPPAN,将cppan.exe所在的文件路径作为环境变量的值。
  2. 下载最新的cmake,解压文件压缩包,将解压后目录下的bin文件夹的目录地址加载至系统环境变量PATH中。
  3. 下载Tesseract最新版的源码:git clone https://github.com/tesseract-ocr/tesseract tesseract
  4. 执行以下命令,编译:
  • cd tesseract
  • mkdir win64 && cd win64
  • cppan ..
  • cmake .. -G "Visual Studio 14 2015 Win64"
  • cppan --generate .
  1. 在win64目录下找到tesseract.sln文件,用VS2015打开该文件,点击【生成】按钮,根据相应错误进行改错。

Tess4.0 常用命令

tesseract::PageSegMode

  • PSM_OSD_ONLY, ///< Orientation and script detection only. 定位和脚本检测
  • PSM_AUTO_OSD, ///< Automatic page segmentation with orientation and < script detection. (OSD) 自动定位、检测、分割
  • PSM_AUTO_ONLY, ///< Automatic page segmentation, but no OSD, or OCR. 自动(仅)分割
  • PSM_AUTO, ///< Fully automatic page segmentation, but no OSD. 完全自动分割
  • PSM_SINGLE_COLUMN, ///< Assume a single column of text of variable sizes. 仅有一列大小变化的文本
  • PSM_SINGLE_BLOCK_VERT_TEXT, ///< Assume a single uniform block of vertically aligned text. 假设一个统一的垂直对齐的文本块
  • PSM_SINGLE_BLOCK, ///< Assume a single uniform block of text. (Default.) 假设一个统一的文本块
  • PSM_SINGLE_LINE, ///< Treat the image as a single text line. 将图像视为一条单独的文本行
  • PSM_SINGLE_WORD, ///< Treat the image as a single word. 单独的词
  • PSM_CIRCLE_WORD, ///< Treat the image as a single word in a circle. 将图像看作一个圆圈中的单个单词
  • PSM_SINGLE_CHAR, ///< Treat the image as a single character. 一个字符
  • PSM_SPARSE_TEXT, ///< Find as much text as possible in no particular order. 找到尽可能多的文本,没有特别的顺序
  • PSM_SPARSE_TEXT_OSD, ///< Sparse text with orientation and script det. 带定向和脚本依据的稀疏文本
  • PSM_RAW_LINE, ///< Treat the image as a single text line, bypassing hacks that are Tesseract-specific. 将图像看作一个单独的文本行,绕过Tesseract-specific的检测
  • PSM_COUNT ///< Number of enum entries. 枚举的条目数

page segmentation modes (psm命令)

  • 0 Orientation and script detection (OSD) only 定位和脚本检测
  • 1 Automatic page segmentation with OSD
  • 2 Automatic page segmentation, but no OSD, or OCR
  • 3 Fully automatic page segmentation, but no OSD. (Default)
  • 4 Assume a single column of text of variable sizes
  • 5 Assume a single uniform block of vertically aligned text
  • 6 Assume a single uniform block of text
  • 7 Treat the image as a single text line
  • 8 Treat the image as a single word
  • 9 Treat the image as a single word in a circle
  • 10 Treat the image as a single character
  • 11 Sparse text. Find as much text as possible in no particular order
  • 12 Sparse text with OSD
  • 13 Raw line. Treat the image as a single text line, bypassing hacks that are Tesseract-specific.

OcrEngineMode (OEM)

  • OEM_TESSERACT_ONLY, // Run Tesseract only - fastest
  • OEM_LSTM_ONLY, // Run just the LSTM line recognizer.
  • OEM_TESSERACT_LSTM_COMBINED, // Run the LSTM recognizer, but allow fallback to Tesseract when things get difficult.
  • OEM_DEFAULT, // Specify this mode when calling init_*(), to indicate that any of the above modes should be automatically inferred from the variables in the language-specific config, command-line configs, or if not specified in any of the above should be set to the default OEM_TESSERACT_ONLY.
  • OEM_CUBE_ONLY, // Run Cube only - better accuracy, but slower
  • OEM_TESSERACT_CUBE_COMBINED, // Run both and combine results - best accuracy
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • **2014真题Directions:Read the following text. Choose the be...
    又是夜半惊坐起阅读 11,209评论 0 23
  • 马月月拖着疲惫的身体回家,今天顶着40°的气温跑了十几个客户,身体已经快虚脱了。 打开门,两岁的儿子兴奋地跑过来:...
    思学乐教育阅读 746评论 2 8
  • 前几天偶遇自己很久之前的学生在马路上哭泣,年龄大概十几岁的样子,具体的已经忘记,原谅我是一个对数字不敏感的人,也经...
    金子媵阅读 253评论 0 0

友情链接更多精彩内容