Ask Your Question
2

opencv OCRTesseract::create v3.05

asked 2017-08-09 10:21:15 -0600

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?

edit retag flag offensive close merge delete

Comments

1

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

sturkmen gravatar imagesturkmen ( 2017-08-09 10:59:11 -0600 )edit
1

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

SarahM gravatar imageSarahM ( 2017-08-10 07:21:27 -0600 )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 ( 2017-08-10 07:28:05 -0600 )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 ( 2017-08-10 07:30:31 -0600 )edit
1

i am also stuck on this point.

sturkmen gravatar imagesturkmen ( 2017-08-10 07:31:31 -0600 )edit
1
sturkmen gravatar imagesturkmen ( 2017-08-10 07:41:50 -0600 )edit
1

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

SarahM gravatar imageSarahM ( 2017-08-10 08:13:50 -0600 )edit

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

sturkmen gravatar imagesturkmen ( 2017-08-10 08:24:19 -0600 )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 ( 2017-08-10 09:23:10 -0600 )edit

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

SarahM gravatar imageSarahM ( 2017-08-10 09:44:21 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
2

answered 2017-08-11 03:03:40 -0600

updated 2019-02-16 11:57:48 -0600

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

edit flag offensive delete link more

Comments

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

SarahM gravatar imageSarahM ( 2017-08-11 07:40:22 -0600 )edit

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

SarahM gravatar imageSarahM ( 2017-08-11 10:23:02 -0600 )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 ( 2017-08-17 07:39:59 -0600 )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 ( 2017-08-17 07:50:54 -0600 )edit

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

SarahM gravatar imageSarahM ( 2017-08-17 08:00:09 -0600 )edit

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

sturkmen gravatar imagesturkmen ( 2017-08-17 08:07:04 -0600 )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 ( 2017-08-17 08:07:26 -0600 )edit
sturkmen gravatar imagesturkmen ( 2017-08-17 08:08:54 -0600 )edit

obviously you should choose your compiler.

sturkmen gravatar imagesturkmen ( 2017-08-17 08:10:11 -0600 )edit

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

SarahM gravatar imageSarahM ( 2017-08-18 06:20:50 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2017-08-09 10:21:15 -0600

Seen: 6,008 times

Last updated: Feb 16 '19