tesseract-ocr 图像识别所遇到的些问题
来源:互联网 发布:创业法学网络课答案 编辑:程序博客网 时间:2024/06/05 23:06
其通过不同的语言训练库可以支持多种语言(包括中文、日文)。
从项目地址http://code.google.com/p/tesseract-ocr下载最新版本的项目
从项目地址http://code.google.com/p/tesseract-ocr下载最新版本的项目
程序安装包:
tesseract-ocr-setup-3.02.02.exe
项目环境搭建:
新建一个文件夹:
tesseract-build,然后再在tesseract-build目录下面创建三个文件:
include
lib
tesseract-ocr
include以及lib对应下载的文件名:tesseract-3.02.02-win32-lib-include-dirs.zip
tesseract-ocr直接到官网下载tesseract-ocr-3.02.02.tar.gz
然后可以打开项目路径下:tesseract-build\tesseract-or\vs2008\tesseract.sln;
vs2008转vs 2010的话,直接把vs2008目录拷贝到当前下面重命名
剩下的就是对工程转换后一些编译环境的错误处理,不详述了;
该项目跑的时候默认读取的语言包是从tesseract-ocr-setup-3.02.02.exe安装路径里面的tessdata文件夹下,例如我的安装路径D:\Program Files (x86)\Tesseract-OCR\tessdata目录下*.traineddata后缀名;
当使用api.init函数的时候,
参数一:表示tessdata所在文件的父路径
参数二:表示tessdata文件下面的语言包名称如eng.traineddata语言包直接填写"eng"就OK了
参数三:tesseract::OEM_TESSERACT_ONLY;可以取如下的值:
enum OcrEngineMode {
OEM_TESSERACT_ONLY, // Run Tesseract only - fastest
OEM_CUBE_ONLY, // Run Cube only - better accuracy, but slower
OEM_TESSERACT_CUBE_COMBINED, // Run both and combine results - best accuracy
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_TESSERACT_ONLY, // Run Tesseract only - fastest
OEM_CUBE_ONLY, // Run Cube only - better accuracy, but slower
OEM_TESSERACT_CUBE_COMBINED, // Run both and combine results - best accuracy
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.
};
初始化语言包,总感觉路径和文件名路径分开不舒服,直接传个语言包的绝对路径不更方便,所以做了如下修改;
我的方法比较简单粗暴,直接修改
bool Tesseract::init_tesseract_lang_data(
const char *arg0, const char *textbase, const char *language,
OcrEngineMode oem, char **configs, int configs_size,
const GenericVector<STRING> *vars_vec,
const GenericVector<STRING> *vars_values,
bool set_only_non_debug_params) 函数;
const char *arg0, const char *textbase, const char *language,
OcrEngineMode oem, char **configs, int configs_size,
const GenericVector<STRING> *vars_vec,
const GenericVector<STRING> *vars_values,
bool set_only_non_debug_params) 函数;
在STRING tessdata_path = language_data_path_prefix + kTrainedDataSuffix;这行代码下面加一行
tessdata_path = arg0;
方便在调用api.init函数的时候可以直接填写好语言包的绝对路径就OK了;
0 0
- tesseract-ocr 图像识别所遇到的些问题
- Android图像识别之tesseract-ocr
- Java中文图像识别tesseract-ocr || tif
- Tesseract-ocr实现图像文本识别
- OCR tesseract中文无法识别问题
- tesseract-ocr识别字符
- tesseract-ocr图片识别
- Tesseract OCR识别小结
- Tesseract ocr文字识别
- Tesseract-OCR 3.0.1训练自己的语言库之图像文字识别
- Java OCR tesseract 图像智能字符识别技术
- Tesseract——OCR图像识别 入门篇
- Java OCR tesseract 图像智能字符识别技术
- Java OCR tesseract 图像智能字符识别技术(一)
- Java OCR tesseract 图像智能字符识别技术
- Java OCR tesseract 图像智能字符识别技术
- Tesseract-OCR图像识别引擎 windows10使用方法入门
- java利用tesseract-OCR对图像进行字符识别
- 开关灯 动态规划
- 检查javascript数组中是否包含某元素
- 项目3~~分数类的运算符重载(扩展)
- ReportStudio入门教程(二十五) - 列表的悬浮提示信息-显示固定信息
- 执行系统命令
- tesseract-ocr 图像识别所遇到的些问题
- 2014.4.15 腾讯实习生一面- -
- FTP上传文件,Apache篇
- Java程序员应该了解的10个面向对象设计原则
- ActionBar总结1_实现menu,Navigate up
- The 18 best image file compression tools
- ORACLE的分区表
- svn的trunck、branches、tags
- poj2078