Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am trying to install Tesseract OCR on OSX 10.6...

I have got as far as installing leptonic (by downloading src from http://www.leptonica.org/download.html and installing with ./configure; make; sudo make install) seemingly without any problems - but I don't know how to check.

I also installed Tesseract OCR 3 (from http://tesseract-ocr.googlecode.com/files/tesseract-3.00.tar.gz with ./runautoconf; ./configure; make; sudo make install) also seemingly without issue - but again I don't know how to check.

When I run tesseract input.jpg . I get error...

bash-3.2$ tesseract ~/Desktop/DCIM/101_FUJI/DSCF1043.JPG . Tesseract Open Source OCR Engine with Leptonica Error in pixReadStreamJpeg: function not present Error in pixReadStream: jpeg: no pix returned Error in pixRead: pix not read Error in fopenReadStream: file not found Error in pixRead: image file not found Image file ######Exif cannot be read! bash-3.2$

Similar error if I use tiff file as input.

I think I need some libraries - instructions for Ubuntu say to install libjpeg12-dev etc...

Does anyone have details of how to install tesseract on OSX?

share|improve this question

3 Answers 3

up vote 2 down vote accepted

Install macports: see http://www.macports.org/ for downloads and installation instructions.

Update the ports tree: sudo port selfupdate

Install tesseract: sudo port install tesseract

The tesseract port doesn't appear to have a variant that supports jpeg so you would need to install a graphic file converter and image adjustment (brightness, contrast and sharpness) package: sudo port install imagemagick

Convert your jpeg to tiff format, then perform OCR on it with tesseract: convert input.jpg input.tiff ; tesseract input.tiff ocr-text-ouput -l eng ; rm input.tiff

The resulting text should be found in the file ocr-text-ouput.txt.

p.s. you can adjust the image a bit for a potentially better OCR experience with convert options like these: convert -sharpen 1 -brightness-contrast 3X30 input.jpg input.tiff

share|improve this answer
    
i had to install 'tesseract-eng' to get around segmentation fault 11. –  Ian Jun 4 '13 at 15:23

I'm using homebrew on osx 10.7 and it was as simple as running these two commands:

brew install leptonica
brew install tesseract

This installed leptonica 1.68 and tesseract 3.01 with their dependencies

share|improve this answer

Working one command solution for me:

sudo brew install tesseract

This install tesseract and all dependencies. sudo necessary for some purposes, like jpeg packet linking.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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