在 https://download.csdn.net/download/null111666/11022326
将字库文件下载下来,然后将其放在项目指定位置,系统能够访问到
ITesseract instance=new Tesseract();
instance.setDatapath("tessdata");
instance.setLanguage("chi_sim");
String result=instance.doOCR(new File(filePath));
在需要识别的位置写上如上代码,将你要识别的file写在new File()里面。