ocrscannerdemo.java

160 2024-03-09 23:23

import net.sourceforge.tess4j.*; import java.io.File; public class OCRScannerDemo { public static void main(String[] args) { File imageFile = new File("image.png"); ITesseract instance = new Tesseract(); try { String result = instance.doOCR(imageFile); System.out.println("OCR 识别结果:"); System.out.println(result); } catch (TesseractException e) { System.err.println(e.getMessage()); } } }
顶一下
(0)
0%
踩一下
(0)
0%
相关评论
我要评论
点击我更换图片