OpenCV with extra modules works, but tesseract is not found

I’ve successfully built openCV libraries with extra modules with CMake, and included the generated header files and libraries in a project + added the binaries folder of the generated CMake build to to the Path system variable (as not including this resulted in a missing .dll error at runtime).
Now the program builds, but tesseract returns: OCRTesseract(33): Tesseract not found.
According to the forum post I have to install tesseract and generate the appropriate .dll.
It did not work and at this point I’m not even sure, whether the functions , the declaration of which is in the header files, are called from the statically linked libraries, or from the .dll-s trough the system Path.

never works as a problem description ;(

please show the cmake console output (from building the libs)

I did not really generate the libraries from CMAke, I just created the VS solution for generating the libraries and then moved the files (headers and static libraries) to a new solutions’ project.

what now ?

the prebuilt static libs (if you try to use those) don’t contain any contrib modules, and were not linked against tesseract

seriously, if you want to use the text module with tesseract, you have to follow the manual, and rebuild it all from src.

also, no use building anything, if cmake did not enable the text module, or tesseract install not found at this early stage.

so, try again, please, show us the output.

No output yet. True, tesseract directory was not found in CMake, so no wonder, that it couldn’t find it. None of the (3) manuals mentioned tesseract explicitly. Now I am about to rebuild everything from scratch. I have the latest prebuild opencv and the contrib modules from git, also tesseract. It looks like I have to build the tesseract libs first (as the folder contains source files only).
Is there any coherent manual, which includes the steps of building opencv with extramodules including tesseract (or any other project libraries used by the modules)?

indeed, you have to.

1 Like

Okay, it is more complicated to add tesseract to the extra modules, than adding extra modules to the openCV main project.
I’ve tried a tutorial provided as an answer to an existing post.
The problem is with building the tesseract binaries. I’ve tried different tesseract versions - the one provided in the before mentioned post, the latest alpha version (5.0.0) and the latest release version (4.1.1).
Upon configuration in CMake (version 3.19.3 with generator VS 16 2019 x64 config.) I get the following error:

CMake Error at src/training/CMakeLists.txt:39 (file):
  file DOWNLOAD HASH mismatch

    for file: [C:/Users/DICAM39/Downloads/tesseract-4.1.1/build/src/training/icu/icu64.zip]
      expected hash: [480c72491576c048de1218c3c5519399]
        actual hash: [d41d8cd98f00b204e9800998ecf8427e]
             status: [6;"Couldn't resolve host name"]

Do I even need to build the binaries from source code, or I can just install tesseract according to a stack overflow post. If the latter is more simple, how do I then give CMake the macros for Tesseract_DIR Tesseract_INCLUDE_DIR Tesseract_LIBRARY to build the OCR extra modules with tesseract?

Is there a fairly recent step-by-step tutorial for this? I couldn’t find one.

maybe one of those prebuilt ones work, but you’d need the same VS version, they were built with

I found different installers, but only a few (usually older versions) have matching releases on github.
I tried it with version 4.0.0-rc4
Same error.