package com.roy;

import net.sourceforge.tess4j.ITesseract;
import net.sourceforge.tess4j.Tesseract;
import net.sourceforge.tess4j.TesseractException;

import java.io.File;

/**
 * @author ：楼兰
 * @date ：Created in 2021/1/19
 * @description:
 **/

public class Tess4jDemo {

    public static void main(String[] args) throws TesseractException {
        final ITesseract instance = new Tesseract();
        instance.setDatapath("D:\\tessdata");
        instance.setLanguage("chi_sim");

        File imageLocation = new File("D:\\verifyImg");
        for(File image : imageLocation.listFiles()){
            System.out.println(image.getName()+" -->"+instance.doOCR(image));
        }
    }
}
