Created
November 5, 2012 10:21
-
-
Save seidler2547/4016486 to your computer and use it in GitHub Desktop.
Bring back the 90s - Babelfish-style on-screen OCR
This file contains 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 | |
# needs: | |
# - bash | |
# - xfce4-screenshooter | |
# - zenity | |
# - ImageMagick | |
# - Tesseract OCR (include the languages you want) | |
[ "$1" ] || exec xfce4-screenshooter -r -o $0 | |
TI=`mktemp` | |
{ echo 0 | |
convert -resize 2000% -filter Welsh "$1" $TI 1>&2 > /dev/null | |
echo 50 | |
tesseract $TI $TI -l 'eng+deu+fra' 1>&2 > /dev/null | |
echo 100 | |
} | if zenity --progress --auto-close | |
then | |
zenity --text-info < $TI.txt | |
else | |
for i in `pgrep -P $$` ; do pkill -P $i ; done | |
pkill -P $$ | |
fi | |
rm -f $TI $TI.txt "$1" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment