Tess4j图像识别java环境配置
一,导入依赖
<dependency>
<groupId>net.sourceforge.tess4j</groupId>
<artifactId>tess4j</artifactId>
<version>4.5.3</version>
</dependency>
第二步,复制jar包中的tessdata到项目根目录
下载中文库:chi_sim.traineddata训练库,自行百度
使用:
public static void main(String[] args) throws TesseractException {
File file = new File("C:\\Users\\qq\\Desktop\\wps\\1.png");
Tesseract tesseract = new Tesseract();
tesseract.setDatapath("C:\\Users\\qq\\Desktop\\wps\\tessdata");
tesseract.setLanguage("chi_sim"