1

I correctly installed OpenCV 3.2 using cmake to generate it from source code as in this link, installed Tesseract 3.05 and leptonica from here. Both work correctly on these sample example RedEyeRemover for OpenCV and opencv-tesseract for testing both together, target project x64 VS2017. But then when applied to end-to-end text recognition demo (Platform toolset VS2015 v140) provided by opencv, I have no error in compilation but get tesseract not found in runtime.

Tesseract not found

    double t_r = (double)getTickCount();
    Ptr<OCRTesseract> ocr = OCRTesseract::create();
    cout << "TIME_OCR_INITIALIZATION = " << ((double)getTickCount() - t_r) * 1000 / getTickFrequency() << endl;
    string output;

It occurs at OCRTesseract::create() level.

What can be the reason if I didn't get any compilation error? It's linked to opencv_text module.

SarahData
  • 769
  • 1
  • 12
  • 38
  • i want to try help you step by step – sturkmen Aug 17 '17 at 13:07
  • ok please create the chat room and put the link, as I don't know how to do. – SarahData Aug 17 '17 at 13:09
  • as i know it will be available after some comments – sturkmen Aug 17 '17 at 13:12
  • `Could NOT find GIF (missing: GIF_LIBRARY GIF_INCLUDE_DIR) Found JPEG: C:/Users/Jihed Mestiri/Anaconda2/Library/lib/jpeg.lib Found ZLIB: C:/Users/Jihed Mestiri/Anaconda2/Library/lib/z.lib (found version "1.2.8") Found PNG: C:/Users/Jihed Mestiri/Anaconda2/Library/lib/png.lib (found version "1.6.17") Found TIFF: C:/Users/Jihed Mestiri/Anaconda2/Library/lib/tiff.lib (found version "4.0.6") Found PkgConfig: C:/cygwin64/bin/pkg-config.exe (found version "0.29.1") Checking for module 'libwebp' No package 'libwebp' found Configuring done` I couldn't put all the output – SarahData Aug 17 '17 at 13:15
  • I don't know how it's getting them from Anaconda.. I cannot remove that? – SarahData Aug 17 '17 at 13:20
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/152157/discussion-between-sturkmen-and-sarah-m). – sturkmen Aug 17 '17 at 13:21
  • `31>C:/Program Files/opencv/opencv_contrib-3.2.0/modules/text/src/precomp.hpp(51): fatal error C1083: Cannot open include file: 'tesseract/baseapi.h': No such file or directory 34>LINK : fatal error LNK1181: cannot open input file '..\..\lib\Release\opencv_text320.lib' 45>LINK : fatal error LNK1181: cannot open input file '..\..\lib\Release\opencv_datasets320.lib'` – SarahData Aug 17 '17 at 19:18
  • do you have tesseract305.dll? when I run RedEyeRemover code I get tesseract305.dll not found as runtime error – SarahData Aug 18 '17 at 12:22
  • put `leptonica-1.74.4.dll`,`tesseract305.dll` and files *.xml *.xml.gz from [here](https://github.com/opencv/opencv_contrib/tree/master/modules/text/samples) in the exe dir – sturkmen Aug 18 '17 at 12:49
  • what exe dir to put them in? – SarahData Aug 18 '17 at 19:49
  • same dir with your exe – sturkmen Aug 18 '17 at 19:52
  • please check my message in chat room. – SarahData Aug 18 '17 at 19:54

1 Answers1

1

just posting an answer stating there is some practical information in chat session about compiling leptonica tesseract and OpenCV

Community
  • 1
  • 1
sturkmen
  • 3,495
  • 4
  • 27
  • 63
  • Thank you for your help in the chat room!Now, tesseract3.05.01 opencv3.2 and leptonica1.74.7 are working all together. However, the project I have a problem in, which is same as text-example-end_to_end_recognition sample, didn't work for me when executing it from its .exe file (closes directly after running it) – SarahData Aug 18 '17 at 22:29