Install ImageMagick for image conversion:
brew install imagemagick
Install tesseract for OCR:
brew install tesseract --all-languages
Or install without --all-languages
and install them manually as needed.
Make sure the input image is a grayscale .tif
and fairly large. ~500x150 was too small, while ~2000*500 worked very well.
convert input.png -resize 400% -type Grayscale input.tif
OCR it. The default language is English. Language codes are 3 chars per man tesseract
.
tesseract -l eng input.tif output
This creates output.txt
.
For imagemagick: stable 7.0.8-14 on OS X 10.9.5 I had to install with
--with-fontconfig
:Compare your results with/without resize as resize can take more resources for no OCR improvement.
For OCR improvements see Improving Quality or try training.