본문 바로가기

OCR/Tesseract

Tesseract, Leptonica 컴파일 및 cmake로 opencv 포함시키기

반응형

출처 : https://answers.opencv.org/question/171470/opencv-ocrtesseractcreate-v305/

 

opencv OCRTesseract::create v3.05 - OpenCV Q&A Forum

opencv OCRTesseract::create v3.05 edit I have the version of tesseract 3.05 and opencv3.2 installed and tested. But when I tried the end-to-end-recognition demo code, I discovered that tesseract was not found using OCRTesseract::create and checked the docu

answers.opencv.org

Step 1.download https://codeload.github.com/DanBloomb...

extract it in a dir like "C:/leptonica-1.77.0"

run cmake

where is the source code : C:/leptonica-1.77.0

where to build binaries : C:/leptonica-1.77.0/build

click Configure button select compiler

see "Configuring done" click Generate button and see "Generating done"

screenshot1

Open Visual Studio 2015 >> file >> open "C:\leptonica-1.77.0\build\build\INSTALL.vcxproj" select release, build INSTALL

see "Build: 3 succeeded" and be sure C:\leptonica-1.77.0\build\src\Release\leptonica-1.77.0.liband C:\leptonica-1.77.0\build\bin\Release\leptonica-1.77.0.dll have been created.

be sure the directory "C:\Program Files\leptonica" is created and files copied into it.


Step 2.download https://codeload.github.com/tesseract...

extract it in a dir like "C:\tesseract-4.0.0"

run cmake

where is the source code : C:/tesseract-4.0.0

where to build binaries : C:/tesseract-4.0.0/build

click Configure button select compiler

see "Configuring done" click Generate button and see "Generating done"

screenshot2

Open Visual Studio 2015 >> file >> open "C:/tesseract-4.0.0\build\ALL_BUILD.vcxproj" build INSTALL


Step 3. in OpenCV cmake set Tesseract_INCLUDE_DIR : C:/Program Files/tesseract/include

set tesseract_LIBRARY C:/Program Files/tesseract/lib/tesseract40.lib

set Lept_LIBRARY C:/Program Files/leptonica/lib/leptonica-1.77.0.lib

when you click Configure button you will see "Tesseract: YES" it means everything is OK

make other settings and generate. Compile ....

반응형

'OCR > Tesseract' 카테고리의 다른 글

Tesseract, Leptonica 설치 정리  (1) 2019.07.23