您的位置:首页 > 编程语言 > C语言/C++

tesseract的一个c++版本demo

2016-11-02 16:36 295 查看


Tesseract Example


Building

Before building take a look at 
cppan.yml
 file. Create a local copy of it in your project structure.
务必安装cppan。其实就是直接下载下来放到环境变量里面。


Windows

Prerequisites:
Download git, cmake and add them to PATH(三个软件缺一不可)
Download the latest CPPAN (https://cppan.org/) client from https://cppan.org/client/
Add cppan to PATH too.
需要安cmake,cmake是一个工具,能够生成与平台无关的makefile,在windows底下能够生成一个vs的工程,直接编译即可
git clone https://github.com/cppan/tesseract_example tesseract_example
cd tesseract_example/with_cmake
cppan
mkdir build && cd build
cmake ..
cmake --build . --config Release

用vs打开.sln文件,在工程里面就可以修改代码。然后编译链接成exe。


Linux

Prerequisites:
Install git, cmake, the latest CPPAN (https://cppan.org/) client.
Run
git clone https://github.com/cppan/tesseract_example tesseract_example
cd tesseract_example/with_cmake
cppan
mkdir build && cd build
cmake ..
make -j4


Testing

Download tesseract english data to 
tessdata
 dir near the 
main
 binary.(在这需要下载个训练好的文件)
Copy test image 
img/phototest.tif

Run 
main phototest.tif


 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: