Scripting an OCR Scan?

Hart Larry chime at hubert-humphrey.com
Sat Jun 29 04:30:27 UTC 2013


First, thanks to Karen, Dallas, and John.  This is a continuing wonderful 
education.
Now last Sunday a gentlman from our LUG wrote a short script, called ocr  but 
as we know, its `really particular on placement.  So considering Dallas 
suggestions of imagemagick, convert, and an item from tesseract manual, I tried 
editing this script, but had to remove all changes, as items stopped working. 
Here is an orriginal script
#!/bin/bash


ocr=$(mktemp -u /tmp/ocr-XXXX)
pnm="${ocr}.pnm"
txt="${ocr}.txt"

scanimage > "$pnm"
tesseract "$pnm" "$ocr"

cat "$txt"

rm "$pnm" "$txt"
  Back again live:  Since I hardly know differences among an alias and a script, 
I would love to incorporate your ideas.  I would also find it hard2believe no1s 
made such a helpful script before?
As you can see, so far we are just printing the live scan, but once we get much 
further, I would certainly want to save or append pages.  I would think an 
interactive, prompting a user on file name and path, or maybe even batch 
scanning.
Thanks so much in advance
Hart




More information about the Blinux-list mailing list