Mac OS X 中 build tesseract source code
2017-03-27 16:41
381 查看
1. 安装homebrew
直接在终端中输入:ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
安装过程中需要键入一次回车
2. 按照Github官方安装依赖
直接在终端中输入:ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
安装过程中需要键入一次回车
2. 按照Github官方安装依赖
brew install automake autoconf brew install autoconf-archive brew install pkgconfig brew install icu4c brew install leptonica brew install gcc
3. compile
git clone https://github.com/tesseract-ocr/tesseract/[/code]在这一步可能会有错误提示:fatal: could not create work tree dir 'tesseract': Permission denied此时需要我们使用sudo创建一个具有写权限的文件夹也可能有错误提示:Agreeing to the Xcode/iOS license requires admin privileges, please re-run as root via sudo.我们需要:1、打开终端,输入 sudo xcodebuild -license
2、终端提示敲回车键(enter)打开许可协议,照做
3、终端提示 按下 “space” 键阅读许可协议,按“q” 不阅读
4、最终,终端会出现三个选项,agree 、print、cancel,不用想,能不是agree 吗!输入agree,然后entercd tesseract ./autogen.sh这一步可能会有错误:“Failed to find libtoolize or glibtoolize...“
只需安装libtool即可:brew install libtool
./configure CC=gcc-6 CXX=g++-6 CPPFLAGS=-I/usr/local/opt/icu4c/include LDFLAGS=-L/usr/local/opt/icu4c/lib
make -j
sudo make install # if desired
make training5.接下来试一下好不好使首先要下载相关语言的数据文件,比如:eng.traineddata 这个在官方github上就有,然后把它move到:/tesseract/tessdata 路径下然后如果出现错误:Please make sure the TESSDATA_PREFIX environment variable is set to the parent directory of your "tessdata" directory.就使用命令:export TESSDATA_PREFIX=/Users/naver/code/tesseract/接下来要提前创建一个文件来存储识别的文字结果,如:out然后输入测试命令:tesseract /Users/naver/Downloads/test.jpg outtest.jpg 为要识别的图片,然后识别结果会存储在out文件中。详细参数参见官方github文档!
相关文章推荐
- mac os x+paralles使用source insight
- Atlas Control Toolkit and Source Code for the Build-in Asp.Net 2.0 Providers
- How to build and debug android source code
- Hadoop 2.x build native library on Mac os x
- Code Sign Error in macOS Sierra Xcode 8 : resource fork, Finder information
- Mac OS X下修改.bash_profile之后source .bash_profile出现“command not found”问题解决
- 苹果发布 Mac OS X 10.6.7 Build 10J860 测试系统
- Atlas Control Toolkit and Source Code for the Build-in Asp.Net 2.0 Providers
- Build WebKit on Mac OS X 10.9
- uc/OS-II source code remark
- xmind source code build
- Find ways to code in Mac OS X
- Source Code Tags and Builds
- 网络安全:PR Source code Build & to avoid killing
- Hadoop 2.x build native library on Mac os x
- build android on macOS
- Build distcc from source code
- 苹果发布 Mac OS X 10.6.7 Build 10J869 测试系统
- Tensorflow source build on MAC EI Capitain
- Notes about compiling android kernel source on Mac OS Lion