Skip to content

Instantly share code, notes, and snippets.

@logbasex
Created May 12, 2020 06:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save logbasex/17f53b4f2d51c804830d0a1ba9053835 to your computer and use it in GitHub Desktop.
Save logbasex/17f53b4f2d51c804830d0a1ba9053835 to your computer and use it in GitHub Desktop.
//https://www.geeksforgeeks.org/tesseract-ocr-with-java-with-examples/
//https://medium.com/@rahulvaish/simple-tesseract-ocr-java-be261e343c5b
public static void main(String[] args) {
Tesseract tesseract = new Tesseract();
try {
//not working perfectly
tesseract.setDatapath("C:\\Users\\conta\\Downloads\\Tess4J\\tessdata");
String text = tesseract.doOCR(new File("C:\\Users\\conta\\OneDrive\\Desktop\\t.png"));
System.out.print(text);
} catch (TesseractException e) {
e.printStackTrace();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment