windows vs 编译tesseract-ocr
第一把所有相关的代码都下载,github最方便 https://github.com/tesseract-ocr/tesseract
要点1、cppan c++的中文管理包,很方便,需要翻-墙,安装包的时候也需要。这个应该会流行起来,肯定会火起来,因为太方便了,在windows上像linux一样安装c++的依赖,而且是跨平台的解决方案!(https://raw.githubusercontent.com/cppan/binaries/master/cppan-master-Windows-client.zip)
要点2、安装cmake,并添加环境变量
cd tesseract
cppan
mkdir build && cd build
cmake ..
Windows
master branch, 3.05 and later
Using Tesseract
!!! IMPORTANT !!! To use Tesseract in your application (to include tess or to link it into your app) see this very simple example https://github.com/tesseract-ocr/tesseract/wiki/User-App-Example.
Build the latest library
- Download the latest CPPAN (C++ Archive Network
https://cppan.org/
) client fromhttps://cppan.org/client/
. - Run
cppan --build pvt.cppan.demo.google.tesseract.tesseract-master
.
Build training tools
Today it is possible to build a full set of tess training tools on Windows with Visual Studio. The latest versions (Win10, VS2015/VS2017) are preferable.
To do this:
- Download the latest CPPAN (C++ Archive Network
https://cppan.org/
) client fromhttps://cppan.org/client/
. - Run
cppan --build pvt.cppan.demo.google.tesseract-master
.
Develop Tesseract
For development purposes of Tesseract itself do the next steps:
- Download and install Git, CMake and put them in PATH.
- Download the latest CPPAN (C++ Archive Network
https://cppan.org/
) client fromhttps://cppan.org/client/
. CPPAN is a source package distribution system. Add CPPAN client in PATH too. (VS2015 redist is required.) - If you have a release archive, unpack it to
tesseract
dir.
If you're using master branch (4.0) run
git clone https://github.com/tesseract-ocr/tesseract tesseract
-
Run
cd tesseract cppan mkdir build && cd build cmake ..
-
Build a solution (
tesseract.sln
) in your Visual Studio version.
For development purposes of training tools after cloning a repo from previous paragraph, run
cppan --build .
You'll see a solution link appeared in the root directory of Tesseract.
Building for x64 platform
If you're building with cppan+cmake, run cmake as follows:
mkdir win64 && cd win64
cppan ..
cmake .. -G "Visual Studio 14 2015 Win64"
If you're building with cppan, edit cppan.yml and uncomment this line:
#generator: Visual Studio 14 2015 Win64 -> generator: Visual Studio 14 2015 Win64
Then run cppan --generate .
- it will create a solution link for you.
(For VS2017, use '15 2017' instead of '14 2015'.)
3.05
If you have Visual Studio 2015, checkout the https://github.com/peirick/VS2015_Tesseract repository for Visual Studio 2015 Projects for Tessearct and dependencies. and click on build_tesseract.bat. After that you still need to download the language packs.
3.03rc-1
Have a look at blog How to build Tesseract 3.03 with Visual Studio 2013.
3.02
For tesseract-ocr 3.02 please follow instruction in Visual Studio 2008 Developer Notes for Tesseract-OCR.
3.01
Download these packages from the Downloads Archive on SourceForge page:
tesseract-3.01.tar.gz
- Tesseract sourcetesseract-3.01-win_vs.zip
- Visual studio (2008 & 2010) solution with necessary librariestesseract-ocr-3.01.eng.tar.gz
- English language file for Tesseract (or download other language training file)
Unpack them to one directory (e.g. tesseract-3.01
). Note that tesseract-ocr-3.01.eng.tar.gz
names the root directory 'tesseract-ocr'
instead of 'tesseract-3.01'
.
Windows relevant files are located in vs2008 directory (e.g. 'tesseract-3.01\vs2008'). The same build process as usual applies: Open tesseract.sln with VC++Express 2008 and build all (or just Tesseract.) It should compile (in at least release mode) without having to install anything further. The dll dependencies and Leptonica are included. Output will be in tesseract-3.01\vs2008\bin (or tesseract-3.01\vs2008\bin.rd or tesseract-3.01\vs2008\bin.dbg based on configuration build).
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· AI与.NET技术实操系列:基于图像分类模型对图像进行分类
· go语言实现终端里的倒计时
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 25岁的心里话
· 闲置电脑爆改个人服务器(超详细) #公网映射 #Vmware虚拟网络编辑器
· 基于 Docker 搭建 FRP 内网穿透开源项目(很简单哒)
· 零经验选手,Compose 一天开发一款小游戏!
· 一起来玩mcp_server_sqlite,让AI帮你做增删改查!!