Ask Your Question
1

opencv OCRTesseract::create v3.05

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

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

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

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

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 -0500 )edit

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 -0500 )edit

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 -0500 )edit

i am also stuck on this point.

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

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

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

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

sturkmen gravatar imagesturkmen ( 2017-08-10 08:24:19 -0500 )edit

@berak have you ever compile Text module with tesseract?

sturkmen gravatar imagesturkmen ( 2017-08-10 08:39:02 -0500 )edit

@sturkmen, sorry, no.

berak gravatar imageberak ( 2017-08-10 09:05:00 -0500 )edit

1 answer

Sort by ยป oldest newest most voted
1

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

sturkmen gravatar image

updated 2017-08-17 03:14:48 -0500

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

image description

i tried to explain the steps

Step 1.download https://github.com/DanBloomberg/lepto...

extract it in a dir like "E:/leptonica-1.74.4"

run cmake

where is the source code : E:/leptonica-1.74.4

where to build binaries : E:/leptonica-1.74.4/build

click Configure button select compiler

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

image description

Open Visual Studio 2015 >> file >> open "E:\leptonica-1.74.4\build\ALL_BUILD.vcxproj" select release, build ALL BUILD

see "Build: 3 succeeded" and be sure E:\leptonica-master\build\src\Release\leptonica-1.74.4.lib and E:\leptonica-1.74.4\build\bin\Release\leptonica-1.74.4.dll have been created image description


Step 2.download https://github.com/tesseract-ocr/tess...

extract it in a dir like "E:/tesseract-3.05.01"

create a directory E:\tesseract-3.05.01\Files\leptonica\include

copy *.h from E:\leptonica-master\src into E:\tesseract-3.05.01\Files\leptonica\include copy *.h from E:\leptonica-master\build\src into E:\tesseract-3.05.01\Files\leptonica\include

run cmake

where is the source code : E:/tesseract-3.05.01

where to build binaries : E:/tesseract-3.05.01/build

click Configure button select compiler

set Leptonica_DIR to E:/leptonica-1.74.4\build click Configure button again see "Configuring done" click Generate button and see "Generating done"

Open Visual Studio 2015 >> file >> open "E:/tesseract-3.05.01\build\ALL_BUILD.vcxproj" build ALL_BUILD

be sure E:\tesseract-3.05.01\build\Release\tesseract305.lib and E:\tesseract-3.05.01\build\bin\Release\tesseract305.dll generated


Step 3. create directory E:\tesseract-3.05.01\include\tesseract

copy all *.h files from

E:\tesseract-3.05.01\api

E:\tesseract-3.05.01\ccmain

E:\tesseract-3.05.01\ccutil

E:\tesseract-3.05.01\ccstruct

to E:/tesseract-3.05.01/include\tesseract

in OpenCV cmake set Tesseract_INCLUDE_DIR : E:/tesseract-3.05.01/include

set tesseract_LIBRARY E:/tesseract-3.05.01/build/Release/tesseract305.lib

set Lept_LIBRARY E:/leptonica-master/build/src/Release/leptonica-1.74.4.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 -0500 )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 -0500 )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 -0500 )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 -0500 )edit

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

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

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

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

obviously you should choose your compiler.

sturkmen gravatar imagesturkmen ( 2017-08-17 08:10:11 -0500 )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 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

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

Seen: 234 times

Last updated: Aug 17