tesseract

集成利用tesseract.exe进行ocr

给你一囗甜甜゛ 提交于 2020-03-08 15:02:52
ocr是一个宽泛的概念。市场上面ocr将一直是一个不断发展、需求强烈的方向。 我认为,从难度上区分,中文ocr难于英文ocr;手写ocr难于印刷ocr。所以两两组合,中文手写体最难(比如毛体,有一些人都识别不了);而英文(数字)印刷体ocr最简单,对于最简单的东西,我认为就可以直接使用tesseract,它本身就是集成了对英文(数字)的识别。将这个功能集成起来,甚至是研究其开源实现,将其融合起来。 下载http://uniontesting.com/thread-32030-1-1.html 比较详细的介绍来自于:http://www.cnblogs.com/brooks-dotnet/archive/2010/10/05/1844203.html 如果采用命令行的方式集成,核心代码,可以达到一定的效果: private void button1_Click(object sender, EventArgs e) { string filePath = @"tesseract.exe"; string paramstr = @"bbb3.jpg r"; System.Diagnostics.Process.Start(filePath,paramstr); } 通过 http://blog.csdn.net/fengbingchun/article/details

Clean text images with OpenCV for OCR reading

核能气质少年 提交于 2020-03-05 04:33:28
问题 I received some images that need to be treated in order to OCR some information out of them. Here are the originals: original 1 original 2 original 3 original 4 After processing them with this code: img = cv2.imread('original_1.jpg', 0) ret,thresh = cv2.threshold(img,55,255,cv2.THRESH_BINARY) opening = cv2.morphologyEx(thresh, cv2.MORPH_OPEN, cv2.getStructuringElement(cv2.MORPH_RECT,(2,2))) cv2.imwrite('result_1.jpg', opening) I get these results: result 1 result 2 result 3 result 4 As you

Tesseract: Differing output / How do I find out which parameters are being used on a given run?

妖精的绣舞 提交于 2020-03-04 23:04:57
问题 Consider this small png image depicting the word 'Account' in black on a white background: For this ground-truth image the output differs between the following two Tesseract command-line operations, with (A) better than (B). (B) is required in order for me as the user to be have any hope of controlling Tesseract's some 660 configuration parameters - but at (A)'s extraction performance. Case A (no config file): tesseract -v test.png test tesseract 4.1.0 leptonica-1.78.0 libgif 5.1.4 : libjpeg

Exception on using ctypes with tesserac-ocr TessPageIteratorBoundingBox

浪尽此生 提交于 2020-03-04 15:34:33
问题 import ctypes import os os.putenv("PATH", r'C:\Program Files\Tesseract-OCR') os.environ["TESSDATA_PREFIX"] = r'C:\Program Files\Tesseract-OCR\tessdata' liblept = ctypes.cdll.LoadLibrary('liblept-5.dll') pix = liblept.pixRead('test.png'.encode()) print(pix) tesseractLib = ctypes.cdll.LoadLibrary('libtesseract-5.dll') tesseractHandle = tesseractLib.TessBaseAPICreate() tesseractLib.TessBaseAPIInit3(tesseractHandle, '.', 'eng') tesseractLib.TessBaseAPISetImage2(tesseractHandle, pix) # text_out =

python图像识别--验证码

感情迁移 提交于 2020-03-02 18:14:33
1、pip3 install pyocr 2、pip3 install pillow or easy_install Pillow 3、安装tesseract-ocr: http://jaist.dl.sourceforge.net/project/tesseract-ocr-alt/tesseract-ocr-setup-3.02.02.exe ,安装在C:\Program Files\下 4、要求python默认安装在C盘 5、找到 pytesseract.py 更改 tesseract_cmd = 'C:/Program Files/Tesseract-OCR/tesseract.exe' 代码: # !/usr/bin/python3.4 # -*- coding: utf-8 -*- import pytesseract from PIL import Image image = Image.open('../jpg/code.png') code = pytesseract.image_to_string(image) print(code)    如果出现错误: 'str' does not support the buffer interface 将 `pytesseract.py` 中的下面语句更换: 1 lines = error_string

C#使用Tesseract OCR 解析验证码

孤街醉人 提交于 2020-03-01 14:20:35
下面介绍一个开源的OCR引擎Tesseract2。值得庆幸的是虽然是开源的但是它的识别率较高,并不比其他引擎差劲。网上介绍Tessnet2也是当时时间排名第三的识别引擎,只是后来慢慢不维护了,目前是Google在维护,大家都知道Google 在搞电子图书馆,每天都有不同类目的书被扫描成电子版。所以有G老大维护,识别率差不到哪里去。呵呵。。别鄙视我。。。 Tessnet2 是用vc ++ 开发的,其中是生成Tessnet2.dll ,我们可以通过.net 来调用内部具体类库实现识别。 Tessnet2的使用: 1、点击 http://files.cnblogs.com/zhuxiangyu/tessnet2_32.rar 链接下载Tessnet2.dll , Tessnet2是支持多国语的。语言包下载链接: http://code.google.com/p/tesseract-ocr/downloads/list 2、将Tessnet2.dll 添加到vs 引用中,和添加.net程序集一样。 3、用Tessnet2进行识别 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 WebRequest request = WebRequest.Create( " http://sz.2zf.cn/js/code2.asp " ); WebResponse

pytesseract.pytesseract.TesseractError: (3221225477, '')

走远了吗. 提交于 2020-02-29 03:08:15
在 完全 (注意这个完全)设置环境变量后如遇到这个报错,最好是换版本,很多回答基本换汤不换药,而且还解决不了问题,该问题主要存在3.02 和 4.0版本。 建议下载5.0 或 3.05版本 ,本人在下载完5.0版本后解决该问题,浪费我一整个下午… https://digi.bib.uni-mannheim.de/tesseract/tesseract-ocr-w32-setup-v5.0.0-alpha.20200223.exe(32 bit) https://digi.bib.uni-mannheim.de/tesseract/tesseract-ocr-w64-setup-v5.0.0-alpha.20200223.exe(b4 bit)resp. 如有需求 附上各版本下载地址 https://github.com/UB-Mannheim/tesseract/wiki 希望可以帮助到你们 来源: CSDN 作者: Ddd小狗和小马 链接: https://blog.csdn.net/weixin_43492780/article/details/104553571

ocr 连接开源项目

泄露秘密 提交于 2020-02-27 02:32:39
https://github.com/Raymondhhh90/idcardocr:web部署,第二代居民身份证信息识别,速度略慢,待优化 https://github.com/wzb19960208/idCardRecognition身份证识别 https://github.com/rmtheis/android-ocr基于Tesseract的身份证识别 https://github.com/developer79433/passport_mrz_detector_cpp护照识别 https://github.com/evilgix/Evil: 银行卡、身份证、门牌号光学识别 https://github.com/YCG09/chinese_ocr:基于Tensorflow和Keras实现端到端的不定长中文字符检测和识别 说明:样本有300万张 https://github.com/AstarLight/CPS-OCR-Engine:3755个(一级字库)的印刷体汉字识别 https://github.com/senlinuc/caffe_ocr:CNN+BLSTM+CTC的识别架构 https://github.com/simplezhli/Tesseract-OCR-Scanner:基于Tesseract-OCR实现自动扫描识别手机号 车牌识别 https://github

python提取图片内容并转换成对应表格的markdown代码

一曲冷凌霜 提交于 2020-02-26 18:45:30
本节我们将介绍使用python识别一张图片中的内容,并试着得到一张表格,当然并不是类似于Excel的表格,而是该表格的markdown代码。 注:原创内容,转载请标明出处! 相关工具的安装 本次实验环境:win10,Pycharm2019.3。 安装相关库既可以使用命令行,也可以使用Pycharm自带的工具。 打开cmd命令行或者powershell。 首先安装PIL: pip install Pillow 这是已经安装好PIL的示意图。 之后,安装pytesseract: pip install pytesseract 这是已经安装好pytesseract的示意图。 接下来,安装 Tesseract-OCR ,注意对应系统。 环境配置,输入 tesseract tesseract -v 如果正常输出,表示配置成功了(我在实际操作时,安装完成后自动配置了系统变量),如果没有,找到之前安装的路径: 例如: G:\Program Files (x86)\Tesseract-OCR 将该路径添加到系统变量中 如果你想做英文之外的识别,Tesseract-OCR是没有带其他语言包的,你可以去 下载其他语言包 。 这里我添加了简体中文的语言包,但是使用的是自带的英文语言包。 同时,我们还需要一项配置,找到python安装路径下的pytesseract.py,我这里的路径是 G:

Tesseract

点点圈 提交于 2020-02-26 17:16:15
最近将族谱数字化,需要用到OCR软件。选择了Tesseract,但是官网的指南不是很亲切,所以记录了一些要点和脚本。 要点 族谱通常是竖向编排的,所以psm(页面分割模式)选项要用5。 合并多图,要先将图单独转换成tif格式,再进行合并。 LSTM引擎生成的盒子都是一条条的,和Legacy引擎框住单个字符的不一样。 LSTM盒子文件每一列文字最后要有一行\t开头的座标以示分隔。 训练时最好使用阈值“ --target_error_rate 0.001 ”。 参考: https://blog.csdn.net/qq_19313495/article/details/102977915 https://blog.csdn.net/Hu_helloworld/article/details/100923215 脚本 #!/bin/sh export TESSDATA_PREFIX=/usr/share/tesseract/tessdata f_img=$1 nm=${f_img%.*} convert $f_img -density 300 $f_img convert $f_img $nm.tif #生成box tesseract $nm.tif $nm -l chi_sim_vert --psm 5 lstmbox #处理box ##把字符串拆成单独一行,每11行用?分隔 cat