macOSでOCRしたいのでPythonを書いたけど、自分の手元でもいちいちそのディレクトリに移動するのが面倒になったので、パッケージにしました。
以下でインストールできるはず。
brew tap rioriost/macocr
brew install macocr
使いかたはこれ。
macocr --help
usage: macocr [-h] image_dir output_dir
positional arguments:
image_dir Directory containing images to OCR
output_dir Directory to output OCR results
options:
-h, --help show this help message and exit
実行すると、指定したoutput_dirにテキストファイルが保存されます。
macocr images results
Processing /Users/rifujita/ownCloud/bin/macocr/images/img_horz01.png
Processing /Users/rifujita/ownCloud/bin/macocr/images/img_vert02.HEIC
Processing /Users/rifujita/ownCloud/bin/macocr/images/img_vert01.png