1

I want to use an OCR program to obtain some text in an image. The text is not black on white so I don't know if it will be possible.

wget -q -O image http://4.bp.blogspot.com/-mIE4JlppKMU/T9_mxKR__wI/AAAAAAAAASs/deHLBL21ZbE/s640/Temple%20Garden.png
convert image -crop 90%x12% +repage name
tesseract name-0 stdout
rm name-* image
wget -q -O image http://4.bp.blogspot.com/-roqIxFx13vQ/T981I3wqwOI/AAAAAAAAAQ0/cJk5AWocPO0/s1600/Tundra.png
convert image -crop 90%x12% +repage name
tesseract name-0 stdout
rm name-* image
wget -q -O image http://2.bp.blogspot.com/-gwU4mAyVWtQ/T3rwIPoaBHI/AAAAAAAAAGA/oqU6T1bxqo0/s1600/Goblin%20Grenade.png
convert image -crop 90%x12% +repage name
tesseract name-0 stdout
rm name-* image

The expected output is:

Temple Garden
Tundra
Goblin Grenade

I also want to manage the error. If it fails I wan't to make an if statement saying "Can't get name".

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.