CMake for Tesseract and OpenCV

那年仲夏 提交于 2019-12-05 21:07:00

I wrote a CMakeLists.txt like this

cmake_minimum_required (VERSION 2.6)
project (test-ocr)

# Add the including directory of the tesseract 
# and please replace with your dir.
include_directories (/home/ytxie/include)
# Add the search directory for the tesseract library 
# and please replace with your dir.
link_directories (/home/ytxie/lib)

add_executable (test-ocr test.cpp)

# link the leptonica library and the tesseract library
target_link_libraries (test-ocr lept tesseract)

I've add comments and it seems easy to understand. The test.cpp is just the that example code.

And if you want to add OpenCV relating setting into this cmake file, just add them. If there are some confusing things please read the CMake's document.

NOTE: to make the test-ocr run successfully, you should download the English data and copy it's content into the /share/tessdata.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!