I'm trying to work with text recognition on raspberry pi for a project of mine. I've installed tesseract ocr v4.0.0 beta on my Windows computer, and I'm trying to install this version as well on the RPi, but I only manage to install the 3.0.3 version. I don't know if it is possible to install de 4.x beta on RPi.

I assume it must be possibe since on the github page there is an installation guide for some Linux distros. The one I tried is for Debian Strech, since Raspian is based on this, but well, it installed 3.0.3.

I was wondering is anyone can tell me if this is possible or has a guide for me to achieve this.

  • It looks like you're going to have to build it from git. Try these instructions. – HeatfanJohn Sep 20 '18 at 0:56
  • 1
    Please note that questions should not be cross posted to multiple sites on the Stackexchange network. Please pick one and delete the other. Thanks. – Ghanima Sep 20 '18 at 10:08
  • @HeatfanJohn thank you! I'll try this and let you know! – Jhon Sep 20 '18 at 12:45

Raspbian is Debian based therefore we should follow the instructions for installing on Debian.

However following these instructions shows that this repo doesn't support the armhf architecture.

N: Skipping acquire of configured file 'main/binary-armhf/Packages' as repository 'https://notesalexp.org/tesseract-ocr/stretch stretch InRelease' doesn't support architecture 'armhf'

I was able to build from the Git source and install using the following commands from these instructions:

$ git clone --depth 1  https://github.com/tesseract-ocr/tesseract.git 
$ cd tesseract-ocr/
$ ./autogen.sh
$ ./configure
$ make
$ sudo make install
$ sudo ldconfig
$ tesseract -v

tesseract 4.0.0-beta.3
libgif 5.1.4 : libjpeg 6b (libjpeg-turbo 1.5.1) : libpng 1.6.28 : libtiff 4.0.8 : zlib 1.2.8 : libwebp 0.5.2 : libopenjp2 2.1.2

Hey, guess what ... it works!

$ tesseract img.png outputbase
Tesseract Open Source OCR Engine v4.0.0-beta.3 with Leptonica

$ more outputbase.txt
The (quick) [brown] {fox} jumps!
Over the $43,456.78 <lazy> #90 dog
& duck/goose, as 12.5% of E-mail
from aspammer@website.com is spam.
Der ,schnelle” braune Fuchs springt
iiber den faulen Hund. Le renard brun
«rapide» saute par-dessus le chien
paresseux. La volpe marrone rapida
salta sopra il cane pigro. El zorro
marron ripido salta sobre el perro
perezoso. A raposa marrom ripida
salta sobre o cdo preguigoso.

For this image: Test image for OCR

|improve this answer|||||
  • Hello, thank you for you answer! I tried it, but I'm getting the error that is suggested in the compiling guide you left me on the comment. I tried using the autorecong -i but it didn't work. Do you think I have to first install tesseract-ocr via apt install and then tried the compiling guide ? Thanks! – Jhon Sep 22 '18 at 2:22
  • @Jhon I didn't have to install tesseract-ocr. I'm Raspbian Stretch 9. What version are you running? – HeatfanJohn Sep 22 '18 at 3:07
  • Raspbian 8 (jessie) – Jhon Sep 22 '18 at 3:44
  • 1
    Are you able to upgrade to Raspbian 9 Stretch or try using a different SD Card with Stretch preinstalled. I didn't have any issues building OpenCV on Stretch. Although it was built for Python 3 and the opencv-people-counter project is using Python 2 syntax. – HeatfanJohn Sep 23 '18 at 17:51
  • 1
    I'd like to thank you a lot man! It worked with Raspbian 9! – Jhon Sep 24 '18 at 13:08

you'll find a version 4 in the stretch-backports repository.

|improve this answer|||||
  • OP is running Raspbian Jessie and AFAIK there is no Raspbian Stretch backports repo. How should OP install it? – Dirk Sep 20 '18 at 12:34
  • He can use the arm packages from debian stretch-backports. armel or armhf, depending on his hardware. – Gerard H. Pille Sep 20 '18 at 12:37
  • 2
    I don't think you should assume OP knows this. Maybe you should update your answer with this information – Dirk Sep 20 '18 at 12:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.