Tesseract的使用
参考:http://blog.csdn.net/qy20115549/article/details/78106569

下载tess4j的安装包。
首先,在该网站中下载tess4j的安装包。
https://sourceforge.net/projects/tesseract-ocr-alt/files/?source=navbar
比如,我下载的。

在maven中添加依赖jar包
<dependency>
<groupId>net.sourceforge.tess4j</groupId>
<artifactId>tess4j</artifactId>
<version>3.4.1</version>
</dependency>
代码
package yanzhengma; import java.io.File;
import net.sourceforge.tess4j.ITesseract;
import net.sourceforge.tess4j.Tesseract;
import net.sourceforge.tess4j.TesseractException; public class Test {
public static void main(String[] args) {
try {
File imageFile = new File("e:\\login.jpg");//图片位置
ITesseract instance = new Tesseract(); // JNA Interface Mapping
instance.setDatapath("F:\\Program Files (x86)\\Tesseract-OCR\\tessdata");//设置tessdata位置
instance.setLanguage("osd");//选择字库文件(只需要文件名,不需要后缀名)
String result = instance.doOCR(imageFile);//开始识别
System.out.println("图片实际为:7588"+"\t图片识别结果为:"+result);//打印图片内容
} catch (TesseractException e) {
e.printStackTrace();
}
}
}
Tesseract的使用的更多相关文章
- selenium使用笔记(二)——Tesseract OCR
在自动化测试过程中我们经常会遇到需要输入验证码的情况,而现在一般以图片验证码居多.通常我们处理这种情况应该用最简单的方式,让开发给个万能验证码或者直接将验证码这个环节跳过.之前在技术交流群里也跟朋友讨 ...
- [转]Tesseract 3.02中文字库训练
下载chi_sim.traindata字库下载tesseract-ocr-setup-3.02.02.exe 下载地址:http://code.google.com/p/tesseract-ocr/d ...
- tesseract 编译与使用(windows)
tesseract是google的一个开源OCR项目,项目地址已经迁移到github(现在 2016/09),地址 https://github.com/tesseract-ocr/tesseract ...
- Tesseract API在VS 2013中的配置以及调用
[Tesseract]Tesseract API在VS 2013中的配置以及调用 时间:2016-05-31 20:35:19 阅读:127 评论:0 收藏:0 ...
- tesseract配置过程
tesseract配置过程: 1. 为了避免配置环境变量,可以先下载一个 tesseract-ocr-setup-3.02.02.exe(tesseract配置文件夹里有),然后安装(假设安装目录为D ...
- CMakeLists for tesseract
在网上找了很多,直接用都不行,试了半天的到以下的结果. cmake_minimum_required(VERSION 2.8) project( test ) include_directories ...
- alfresco install in linux, and integrated with tesseract ocr
本文描述在Linux系统上安装Alfresco的步骤: 1. 下载安装文件:alfresco-community-5.0.d-installer-linux-x64.bin 2. 增加执行权限并执行: ...
- Atititi tesseract使用总结
Atititi tesseract使用总结 消除bug,优化,重新发布.当前版本为3.02 项目下载地址为:http://code.google.com/p/tesseract-ocr. Window ...
- tesseract ocr文字识别Android实例程序和训练工具全部源代码
tesseract ocr是一个开源的文字识别引擎,Android系统中也可以使用.可以识别50多种语言,通过自己训练识别库的方式,可以大大提高识别的准确率. 为了节省大家的学习时间,现将自己近期的学 ...
- tesseract api C++使用例子
转自:https://code.google.com/p/tesseract-ocr/wiki/APIExample APIExample API examples Updated Aug 12, 2 ...
随机推荐
- hdu 1081 & poj 1050 To The Max(最大和的子矩阵)
转载请注明出处:http://blog.csdn.net/u012860063 Description Given a two-dimensional array of positive and ne ...
- Fckeditor常见漏洞的挖掘与利用整理汇总
查看编辑器版本号 FCKeditor/_whatsnew.html ------------------------------------------------------------- 2. V ...
- kubernetes对象之cronjob
系列目录 类似于Linux的Cron模块,CronJob用来运行定时性任务,或者周期性.重复性任务.注意CronJob启动的是kubernetes中的Job,不是ReplicaSet.DaemonSe ...
- 【剑指Offer学习】【面试题62:序列化二叉树】
题目:请实现两个函数,分别用来序列化和反序列化二叉树. 解题思路 通过分析解决前面的面试题6.我们知道能够从前序遍历和中序遍历构造出一棵二叉树.受此启示.我们能够先把一棵二叉树序列化成一个前序遍历序列 ...
- 解决Linq.ToDictionary()时的键重复问题
今天在使用 Linq 的 ToDictionary() 时发生了异常,提示: System.ArgumentException: 已添加了具有相同键 因为以前一直没有遇到有相同键的情况,所以从来没关注 ...
- 九度OJ 1129:Skew数 (大数运算)
时间限制:1 秒 内存限制:32 兆 特殊判题:否 提交:734 解决:548 题目描述: 在 skew binary表示中, 第 k 位的值xk表示xk*(2k+1-1). 每个位上的可能数字是0 ...
- Jsp中操作页面显示
通常我们想改变网页中的显示可以用下面的方式. <script type="text/javascript">function show(){ document. ...
- 02-线性结构3 Reversing Linked List(25 point(s)) 【链表】
02-线性结构3 Reversing Linked List(25 point(s)) Given a constant K and a singly linked list L, you are s ...
- 需要注意的一些Mysql语句
1. 日期处理函数:date_format() select COUNT(*) from (SELECT SERIAL_NO, APPLY_SERIAL_NO, FLAG, PAY_DATE, SEQ ...
- Ubuntu下安装Python3.4及用python编译py文件
1.安装python 3.4程序 sudo apt-get install python3.4 2.python 3.4是被默认安装在/usr/local/lib/python3.4,删除默认pyth ...