#!/bin/bash
# OCRs an area selected by the user and puts result into the clipboard
# Author: Adrian Rivera Balasquide

SRC_IMG="/tmp/japanese"
rm -f /tmp/japanese*

scrot -s -f $SRC_IMG.png -q 100
# increase image quality with option -q from default 75 to 100

mogrify -modulate 100,0 -resize 400% $SRC_IMG.png 
#should increase detection rate

tesseract -l jpn $SRC_IMG.png $SRC_IMG
cat $SRC_IMG.txt | tr -d " \t\n\r" | xclip

exit
