Skip to content
Advertisement

Processing Images for TessJ4

Sample Image Being Given to Tessj4 for OCR

I am giving this image to Tessj4 and for whatever reason it cannot recognize this text as 0/0/0. Any recommendations as to how I can process the image or change my code to get tessj4 to recognize this?

Tesseract instance = new Tesseract();
instance.setTessVariable("user_defined_dpi", "360");
instance.setDatapath("tessdata");
String result = null;
try {
    result = instance.doOCR(imageFile);
        
} catch (TesseractException e) {
    System.err.println(e.getMessage());
}

Advertisement

Answer

Inverting the image (color) produced the correct results for me.

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement