Created
October 16, 2014 14:39
-
-
Save innermond/aa10a75a0fdf42c0d837 to your computer and use it in GitHub Desktop.
A picture worths a thousand words, really? Let see how many, indeed!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # path where reside images for OCR | |
| path=$1 | |
| filename='' | |
| ocrized='' | |
| home=$(pwd) | |
| # cd $path | |
| # create a collecting file for ocr text | |
| collector=$2 | |
| # cycle through all images and ocr-ize them | |
| for file in $(ls -f $path/*.png); do | |
| # filename=$path/$file | |
| filename=$file | |
| ocrized="${filename%.*}.txt" | |
| echo "ocr-ize $filename" | |
| if [ -f $filename ]; then | |
| tesseract $filename ${filename%.*} | |
| echo "append ocr $ocrized to collector file $collector" | |
| cat $ocrized >> $collector | |
| # echo $ocrized | |
| fi | |
| done | |
| # cd home |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment