Saturday, June 29, 2019

Reading texts on the image by using Apache Tess4j


import java.io.File;
import net.sourceforge.tess4j.Tesseract;
import net.sourceforge.tess4j.TesseractException;
/*<dependency>
<groupId>net.sourceforge.tess4j</groupId>
<artifactId>tess4j</artifactId>
<version>4.3.1</version>
</dependency>*/
public class Tesss {
public static void main(String[] args) throws TesseractException {
/*File src = new File("C:\\OCR\\tess.png");
Tesseract tesseract = new Tesseract();
String text = tesseract.doOCR(src);
System.out.println(text);*/
System.out.println(new Tesseract().doOCR(new File("C:\\OCR\\tess.png")));
}
}
view raw Tesss.java hosted with ❤ by GitHub