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 themain
binary.(在这需要下载个训练好的文件) - Copy test image
img/phototest.tif
- Run
main phototest.tif