about ocr - tesseract documentation on OpenCv 3.0.0 [closed]

asked 2015-05-06 07:14:07 -0600

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

edit retag flag offensive reopen merge delete

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 ( 2015-05-06 08:29:39 -0600 )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 ( 2015-05-06 11:42:33 -0600 )edit
mshabunin gravatar imagemshabunin ( 2015-05-07 04:27:26 -0600 )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 ( 2015-05-07 12:16:05 -0600 )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 ( 2015-05-08 08:23:16 -0600 )edit

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

mau gravatar imagemau ( 2015-05-08 15:55:41 -0600 )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 ( 2015-05-11 10:21:20 -0600 )edit
1

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

mshabunin gravatar imagemshabunin ( 2015-05-11 13:03:38 -0600 )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 ( 2015-05-12 03:45:01 -0600 )edit
1

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

mshabunin gravatar imagemshabunin ( 2015-05-12 06:35:20 -0600 )edit