0

I would like install correctly Opencv_contrib for Text_recognition. Have you a idea to the good process?

Before I install Opencv 3.1.0 and opencv_contrib, I install leptonia-1.73, protobuf, caffe, and after Tesseract. After I start to install Opencv 3.1.0 and opencv_contrib. But I don't use Texte module

Process: 1. Install leptonia :

$ sudo apt-get install autoconf automake libtool

$ sudo apt-get install libpng12-dev

$ sudo apt-get install libjpeg62-dev

$ sudo apt-get install libtiff4-dev

$ sudo apt-get install zlib1g-dev

$ sudo apt-get install libicu-dev

$ sudo apt-get install libpango1.0-dev

$ sudo apt-get install libcairo2-dev

$ wget http://www.leptonica.org/source/leptonica-1.73.tar.gz

$ tar -zxvf leptonica-1.73.tar.gz

$ cd leptonica-1.73

$ ./autogen.sh

$ ./configure

$ make

$ sudo checkinstall

$ sudo ldconfig

2. Install protobuf

like "https:"//launchpad."net/ubuntu/trusty/"+package/protobuf-compiler"

3. Install Caffe

like "http:"//caffe."berkeleyvision."org"/install_apt"."html

4. Install Opencv 3.1.0 with Opencv_extra_module_path

$ cd ~/opencv

$ mkdir build

$ cd build

$ cmake -D CMAKE_BUILD_TYPE=RELEASE \

-D CMAKE_INSTALL_PREFIX=/usr/local \

-D INSTALL_C_EXAMPLES=OFF \

-D INSTALL_PYTHON_EXAMPLES=ON \

-D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib/modules \

-D BUILD_EXAMPLES=ON ..

Warning message:

Warning message is : joboxlearning@joboxlearning-VirtualBox:~/OpenCV/workspace/text_recognition$ ./Text_recognition 2856985-origpic-28a761.jpg

./Text_recognition

Demo program of the Extremal Region Filter algorithm described in Neumann L., Matas J.: Real-Time Scene Text Localization and Recognition, CVPR 2012

init done opengl support available OpenCV Error: Bad argument (Default classifier file not found!) in ERClassifierNM1, file /home/joboxlearning/OpenCV/opencv_contrib/modules/text/src/erfilter.cpp, line 1035 terminate called after throwing an instance of 'cv::Exception' what(): /home/joboxlearning/OpenCV/opencv_contrib/modules/text/src/erfilter.cpp:1035: error: (-5) Default classifier file not found! in function ERClassifierNM1

Abandon (core dumped)

TJ_learn
  • 1
  • 3

1 Answers1

0

Check this Dockerfile (https://gist.github.com/joost/52d59321abe31884ab818b806c69426b) it shows all steps to install OpenCV 3.1 with Tesseract and Python bindings. You should be able to use all features like OCR and ERFilter.

To test them open python:

>>> import cv2
>>> cv2.__version__
'3.1.0'
>>> cv2.text # should return the module
joost
  • 6,549
  • 2
  • 31
  • 36