
去网上下载这些东西
可以直接下载我的。粉丝免费
https://download.youkuaiyun.com/download/java_option/14922781
具体使用很简单
<dependency>
<groupId>net.sourceforge.tess4j</groupId>
<artifactId>tess4j</artifactId>
<version>3.4.0</version>
</dependency>
ITesseract instance = new Tesseract();
//设置训练文件目录
instance.setDatapath("D:\\java\\tessdata");
//设置训练语言
instance.setLanguage("chi_sim");
//执行转换
String result = null;
try {
result = instance.doOCR(bufferedImage);
System.out.println("股票代码" + result);
} catch (TesseractException e) {
e.printStackTrace();
}
return result;

我用它来提取股票代码
纯数字还是没啥压力的。
使用Tess4J进行OCR文字识别
该博客介绍了如何利用Tess4J库在Java中进行OCR操作,特别是针对股票代码的数字识别。通过设置训练文件目录和语言,可以轻松执行转换并提取纯数字内容。示例代码展示了如何配置和调用Tesseract实例进行股票代码的识别。
3734

被折叠的 条评论
为什么被折叠?



