diff options
Diffstat (limited to 'tools/misc/ocr')
-rwxr-xr-x | tools/misc/ocr | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/tools/misc/ocr b/tools/misc/ocr deleted file mode 100755 index 26594fe..0000000 --- a/tools/misc/ocr +++ /dev/null | |||
@@ -1,16 +0,0 @@ | |||
1 | #!/bin/bash | ||
2 | # Dependencies: tesseract-ocr imagemagick scrot xsel | ||
3 | |||
4 | SCR_IMG=`mktemp` | ||
5 | trap "rm $SCR_IMG*" EXIT | ||
6 | |||
7 | scrot -s $SCR_IMG.png -q 100 | ||
8 | # increase image quality with option -q from default 75 to 100 | ||
9 | |||
10 | mogrify -modulate 100,0 -resize 400% $SCR_IMG.png | ||
11 | #should increase detection rate | ||
12 | |||
13 | tesseract $SCR_IMG.png $SCR_IMG &> /dev/null | ||
14 | cat $SCR_IMG.txt | trans -t zh-TW --brief --engine bing | cat $SCR_IMG.txt - | tr '\n' ' ' | xargs -I{} notify-send --urgency=critical translation '{}' | ||
15 | |||
16 | exit | ||