首页 > 代码库 > tesseract-ocr tips
tesseract-ocr tips
【基本用法】
1、官方:https://github.com/tesseract-ocr
2、基本语法:
Usage:tesseract.exe imagename outputbase [-l lang] [-psm pagesegmode] [configfile...] pagesegmode values are: 0 = Orientation and script detection (OSD) only. 1 = Automatic page segmentation with OSD. 2 = Automatic page segmentation, but no OSD, or OCR 3 = Fully automatic page segmentation, but no OSD. (Default) 4 = Assume a single column of text of variable sizes. 5 = Assume a single uniform block of vertically aligned text. 6 = Assume a single uniform block of text. 7 = Treat the image as a single text line. 8 = Treat the image as a single word. 9 = Treat the image as a single word in a circle. 10 = Treat the image as a single character. -l lang and/or -psm pagesegmode must occur before anyconfigfile. Single options: -v --version: version info --list-langs: list available languages for tesseract engine tesseract imagename outputbase [-l lang] [-psm pagesegmode] [configfile...] tesseract 图片名 输出文件名 -l 字库文件 -psm pagesegmode 配置文件
3、示例:
(1)、
tesseract code.jpg code -l chi_sim -psm 7 digits code 生成code.txt的结果文件 -l chi_sim 表示用简体中文字库 -psm 7 表示告诉tesseract code.jpg图片是一行文本,默认为 3 configfile 参数值为tessdata\configs 和 tessdata\tessconfigs 目录下的文件名 digits 内容为 tessedit_char_whitelist 0123456789-. 表示数字
(2)、白名单
tesseract code.jpg code -l eng -psm 7 -c tessedit_char_whitelist="ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
(2)、黑名单
tesseract code.jpg code -l eng -psm 7 -c tessedit_char_blacklist="abcdefghijklmnopqrstuvwxy"
【训练】
*** walker ***
本文出自 “walker的流水账” 博客,请务必保留此出处http://walkerqt.blog.51cto.com/1310630/1844753
tesseract-ocr tips
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。