tesseract使用

1.下载liblept168.dll和liblept168d.dll文件,下载地址:

http://pan.baidu.com/share/link?shareid=1102209231&uk=101472617&fid=2286174501

http://pan.baidu.com/share/link?shareid=1102209231&uk=101472617&fid=388193021

2.Tesseract-ocr的dll tesseract-3.02.02-win32-lib-include-dirs下载地址:
https://tesseract-ocr.googlecode.com/files/tesseract-3.02.02-win32-lib-include-dirs.zip

解压之后包括 include文件夹和lib文件夹,配置头文件和库文件(VC++ include library, linker),建立工程进行测试。

#include "stdafx.h"
#include "baseapi.h"
#include <iostream>
#pragma  comment(lib,"libtesseract302.lib")
using namespace std;

int _tmain(int argc, _TCHAR* argv[])
{
    char * str = "D:\\validate\\1.png";
    tesseract::TessBaseAPI  api;  
    api.Init(NULL, "chi_sim", tesseract::OEM_DEFAULT);  //初始化,设置语言包,中文简体:chi_sim;英文:eng;也可以自己训练语言包
    //api.SetVariable( "tessedit_char_whitelist", "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" );  
    STRING text_out;  
    bool stauts = api.ProcessPages(str, NULL, 0, &text_out);
    const char *string = text_out.string();
    cout<<string<<endl;
    cout<<endl;

}

 

转载于:https://www.cnblogs.com/taotaowill/p/3601553.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值