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?

link|improve this question
feedback

1 Answer

up vote 1 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

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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