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
.
@gabedot
Homebrew recently decided to remove all options from the homebrew-core Formula's. Though as of right now tesseract now includes all languages by default so just remove the option and you should get all languages. This makes tesseract 680MB by default though so think this should change in the future.
In the medium to short term, you can install tesseract with all language support with this
brew install https://github.com/Homebrew/homebrew-core/raw/10708da5492fa4da6fbf2618210681953219409f/Formula/tesseract.rb
though that's just a reference to a particular version of the Formula so won't receive future updates.