First time here? Check out the FAQ!

Ask Your Question
2

opencv OCRTesseract::create v3.05

asked Aug 9 '17

SarahM gravatar image

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 documentation to find that the interface is for v3.02. Is it possible to use it with Tesseract v3.05 ? How?

Preview: (hide)

Comments

1

did you compiled OpenCV from source? here you can find some basic information.

sturkmen gravatar imagesturkmen (Aug 9 '17)edit
1

Yes I compiled it from source, but it's not opencv 3.0.0 it's opencv3.2

SarahM gravatar imageSarahM (Aug 10 '17)edit
1

OK. i am also trying to compile OpenCV with tesseract. i saw your question on SO. it helped me to build tesseract.

sturkmen gravatar imagesturkmen (Aug 10 '17)edit
1

we need to know right way to define Lept_LIBRARY tesseract_INCLUDE_DIR tesseract_LIBRARY with cmake on OpenCV compilation

sturkmen gravatar imagesturkmen (Aug 10 '17)edit
1

i am also stuck on this point.

sturkmen gravatar imagesturkmen (Aug 10 '17)edit
1
1

I'm also looking at that point.. maybe something missed when building opencv with cmake.

SarahM gravatar imageSarahM (Aug 10 '17)edit

did you get "Tesseract: YES" on cmake while compiling OpenCV

sturkmen gravatar imagesturkmen (Aug 10 '17)edit

thanks @berak this post http://answers.opencv.org/question/16... seems helpful. i am still trying to find the correct way :)

sturkmen gravatar imagesturkmen (Aug 10 '17)edit

@sturkmen I don't remember if Tesseract = YES or not.. I have to repeat configuration I think.

SarahM gravatar imageSarahM (Aug 10 '17)edit

1 answer

Sort by » oldest newest most voted
2

answered Aug 11 '17

updated Feb 16 '19

How to create OpenCV binary files from source with tesseract-4.0.0 ( Windows )

image description

i tried to explain the steps

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.lib and 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 ....

Preview: (hide)

Comments

Thank you! Does OCRTesseract::create work with this compiled version? I mean did you test it?

SarahM gravatar imageSarahM (Aug 11 '17)edit

I didn't understand very well, what are the versions that you tested and worked correctly with OCR tesseract::create?

SarahM gravatar imageSarahM (Aug 11 '17)edit

fatal error C1083: Cannot open include file: 'zlib.h': No such file or directory 2>Done building project "leptonica.vcxproj" -- FAILED. when I build leptonica I get this error..

SarahM gravatar imageSarahM (Aug 17 '17)edit

lets try to compile together (my cmake output for leptonica as below)

Could NOT find GIF (missing:  GIF_LIBRARY GIF_INCLUDE_DIR) 
Could NOT find JPEG (missing:  JPEG_LIBRARY JPEG_INCLUDE_DIR) 
Could NOT find ZLIB (missing:  ZLIB_LIBRARY ZLIB_INCLUDE_DIR) 
Could NOT find PNG (missing:  PNG_LIBRARY PNG_PNG_INCLUDE_DIR) 
Could NOT find TIFF (missing:  TIFF_LIBRARY TIFF_INCLUDE_DIR) 
Could NOT find ZLIB (missing:  ZLIB_LIBRARY ZLIB_INCLUDE_DIR) 
Could NOT find PkgConfig (missing:  PKG_CONFIG_EXECUTABLE) 
Configuring done

how about yours?

sturkmen gravatar imagesturkmen (Aug 17 '17)edit

What's your setup option? Visual Studio 14 2015 Win64?

SarahM gravatar imageSarahM (Aug 17 '17)edit

yes. (this site is too slow) we can use SO chat

sturkmen gravatar imagesturkmen (Aug 17 '17)edit

when I choose that generator I get C++ compiler unknown because I'm using VS 2017 compiler, do you think that can be the reason? but I generated it correctly no errors.. only the build of ALL_BUILD does not succeed

SarahM gravatar imageSarahM (Aug 17 '17)edit

obviously you should choose your compiler.

sturkmen gravatar imagesturkmen (Aug 17 '17)edit

What are the configurations you used for the project ? (Additional Include libraries, Additional Library directories,etc)

SarahM gravatar imageSarahM (Aug 18 '17)edit

Question Tools

1 follower

Stats

Asked: Aug 9 '17

Seen: 6,256 times

Last updated: Feb 16 '19