I am trying to use Ocr frameworks to recognize these type of images: These are 2 letters G.
I tried using the aocr.jar from asprise, but this code does not seem to do the trick..
import com.asprise.ocr.Ocr;
import java.io.File;
public class textRecognizer {
public static void main(String args[]){
Ocr.setUp();
Ocr ocr = new Ocr();
ocr.startEngine("eng", Ocr.SPEED_FAST);
String s = ocr.recognize(new File[] {new File("C:\\Users\\juchtdi\\Pictures\\letter.png")}, Ocr.RECOGNIZE_TYPE_ALL, Ocr.OUTPUT_FORMAT_PLAINTEXT, 0, null);
System.out.println(s.length());
System.out.println(s);
ocr.stopEngine();
}
}
Anyone got an Idea how I can make this work? Eventually with other frameworks?
thanks :)
Edit: The compiling went without any runtime exceptions. s.length() returned 0. So it seems he reads nothing at all.
When i replace the image with an image of real text, it outputs text perfectly.
I expected/hoped for it to return 1 G