Skip to content

Instantly share code, notes, and snippets.

@simion314
Created October 26, 2018 11:42
Show Gist options
  • Save simion314/1670078e298af1a4c466bc16c56738c9 to your computer and use it in GitHub Desktop.
Save simion314/1670078e298af1a4c466bc16c56738c9 to your computer and use it in GitHub Desktop.
using tessauract,imagemagic and jovie to read text from games
#! /bin/bash
import -window root -crop 1120x150+380+946 /home/simi/Apps/TTS-OCR/shot.png
convert -units PixelsPerInch /home/simi/Apps/TTS-OCR/shot.png -adaptive-resize 300% -density 300 -colorspace gray -depth 1 -negate /home/simi/Apps/TTS-OCR/shot2.png
killall tesseract
tesseract -c tessedit_char_whitelist=abcdefghijklmnopqrstuvwxyz --psm 6 /home/simi/Apps/TTS-OCR/shot2.png /home/simi/Apps/TTS-OCR/text-file
qdbus org.kde.KSpeech /KSpeech sayFile /home/simi/Apps/TTS-OCR/text-file.txt 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment