about ocr - tesseract documentation on OpenCv 3.0.0 [closed]

asked May 6 '15

mau gravatar image

Hi guys, I'm still learning OpenCv, excuse me for this question. I have read on documentation (cv::text::OCRTesseract Class Reference), "Notice that it is compiled only when tesseract-ocr is correctly installed". And in the demos seems that ocr is integrated with openCv:

#include "opencv2/text.hpp"
using namespace cv::text;

Has someone a useful link for to install tesseract correctly in OpenCv 3? Thanks for yours time. Maurizio

Preview: (hide)

Closed for the following reason question is not relevant or outdated by sturkmen
close date 2020-10-06 12:46:16.095634

Comments

1

In Linux, all you need is to install Tesseract library development package (sudo apt-get install libtesseract-dev in Debian or Ubuntu) and build OpenCV with text module (from contrib repository).

mshabunin gravatar imagemshabunin (May 6 '15)edit

Thanks for your answer mshabunin, I forgot to say that I work on windows, unfortunately, and I use Visual Studio 2013 express. Sorry for my forgetfulness. M

mau gravatar imagemau (May 6 '15)edit
mshabunin gravatar imagemshabunin (May 7 '15)edit

Hi mshabunin, thanks a lot, for your link, I managed to build correctly, and now I have lib_debug, lib_realease, DLL_debug and DLL_release, now how I make a text module? Thanks for your kindness. Maurizio

mau gravatar imagemau (May 7 '15)edit

You need to build OpenCV from sources (see "Building the library" part of the tutorial).

Make sure that:

  • you provided path to opencv_contrib/modules folder to cmake via the OPENCV_EXTRA_MODULES_PATH variable (command line or GUI)
  • cmake output contains -- Tesseract: YES lines
  • cmake output contains text module in the list of enabled modules:

-- OpenCV modules:

-- To be built: <some modules> text <more modules>

mshabunin gravatar imagemshabunin (May 8 '15)edit

Thanks a lot mshabunin!! I'm going to try this weekend. You are very nice.

mau gravatar imagemau (May 8 '15)edit

Hi mshabunin, I don't understand which path I have to put in the OPENCV_EXTRA_MODULES_PATH. My Tesseract dir is like this:

 C:\Tesseract-Build\
  -- lib # dependences
  -- include #
  -- tesseract-ocr\vs2013\bin\x64\LIB_Release # which contain tesseract.exe and static libs
mau gravatar imagemau (May 11 '15)edit
1

Path to opencv_contrib/modules: clone it from here https://github.com/Itseez/opencv_contrib

mshabunin gravatar imagemshabunin (May 11 '15)edit

II have provided the path via OPENCV_EXTRA_MODULES_PATH, but In cmake output I do not find -- Tesseract: YES and there isn't text module.. This is a part of my cmake output:

OpenCV modules:
To be built:                 hal core flann imgproc ml photo video imgcodecs shape videoio highgui objdetect superres ts features2d calib3d stitching videostab
Disabled:                    python3 world
Disabled by dependency:      -
Unavailable:                 androidcamera cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev java python2 viz
mau gravatar imagemau (May 12 '15)edit
1

The contrib repository was not found, check cmake output for warnings/errors.

mshabunin gravatar imagemshabunin (May 12 '15)edit