I have a question regarding OCR

http://www.magicandlove.com/blog/2015/11/26/processing-with-ocr/

The version I’m using: tess4j-3.4.8.jar

import net.sourceforge.tess4j.*;
import java.awt.image.BufferedImage;
 
Tesseract ocr;
BufferedImage img;
PImage pimg;
String res, show;
int idx;
 
void setup() {
  size(400, 600);
  background(0);
  ocr = new Tesseract();
  ocr.setDatapath(dataPath(""));
  ocr.setLanguage("ssd");
  
  pimg = loadImage("a4.jpg");
  img = (BufferedImage) pimg.getNative();
  show = "";
  idx = 0;
  try {
    res = ocr.doOCR(img);
    println(res);
  } 
  catch (TesseractException e) {
    println(e.getMessage());
  }
  frameRate(25);

}

I want to operate using the ‘ssd.traineddata’ used in the site above, but an error occurs.

Failed loading language 'ssd'
Tesseract couldn't load any languages!

By any chance, does anyone know the cause?

Works on tess4j-4.0.0.

It is recognized only by putting a number in front of the 7-segment number.

Environment :

  1. Works on tess4j-4.0.0.
  2. ssd.traineddata

The problem is that the number must be entered arbitrarily in front of it to be interpreted.
It is not immediately recognized as a 7-segment number.
Why?

1 Like