Translation:How to build Tesseract 3.03 with Visual Studio 2013 (翻译《VS2013 建立tesseract3.03工程》)

                       How to build tesseract 3.03 with Visual Studio 2013
                     Visual studio2013 建立tesseract3.03工程


                                                 By Paul Vorbach2014-04-10

 


注:本教程由Paul Vorbach写于 http://vorba.ch/2014/tesseract-3.03-vs2013.html
仅作翻译。






正文:


    Compiling Tesseract 3.02.02 with Visual C++2008 (Express) is covered by the documentation whereas compiling Tesseract 3.03 isn’t covered at all, though.

    使用visual C++2008(Express)来编译tesseract3.02.02的教程在这里。但是编译tesseract3.03没有涉及到。


    Unfortunately newer versions of Tesseract also require a new version of Leptonica , a Clibrary for image processing and image analysis applications, which in turn requires new versions of zlib, libpng, libtiff, libjpeg and giflib. Tesseract provides pre-compiled versions of Leptonica, which prevents you from having tocollect and set up projects for all of these libraries in Visual Studio, which can be a tedious task.

    Tesseract的最新版本需要依赖于Leptonica 的最新版本。Leptonica是用于图像处理和图像分析应用的C库,需要新版本的zlib、libpng,libpng、libtiff、libjpeg、giflib。Tesseract 提供了Leptonica 的预编译版本,避免你需要为VisualStudio 所有的库去收集、建立工程。

    

    Yesterday I found a project on GitHub that includes a Visual Studio solution file for all dependencies required to compileTesseract 3.03: charlesw/tesseract-vs2012 . While following the build instructions there, I stumpled over several build errors, which I could easilyre solve by removing a definition. The necessary change is in my fork of the repository mentioned above.

    Paul发现了GitHub上的一个visual studio解决方案,这包括了编译tesseract3.03所需要的依赖关系: charlesw/tesseract-vs2012。Paul在编译这份方案的时候发现有些错误,通过移除定义来解决了几个错误。最主要的改变在于存储库。

    

    This is a write-up of all steps that are required to compile Tesseract 3.03 with Visual Studio 2013. 

    接下里是所有的Vs2013建立tresseract3.03工程的步骤。


Prerequisites

前期工作:


1. Install Git

 安装git


2. Install SVN. There are many versions of SVN. You can, for example, install the binary package from SlickSVN for free.

安装svn。SVN有许多版本。比如SlickSVN。


3. Install Visual Studio 2013 for WindowsDesktop (the Express version will be enough). You don’t need the optional features except for “Microsoft Foundation Classes for C++”.

安装vs2013(Express已经够用了)在可选特征里面只需选择“Microsoft Foundation Classes for C++".


Building the dependencies

安装依赖关系(即编译Leptonica


1. Create a directory where you want to compile Tesseract. In this document, I’ll assume it’s C:\Tesseract-Build\.

创建一个文件夹来编译tesseract。本文假定C:\Tesseract-Build\


2. Open a CMD prompt and change to that directory.

打开CMD命令行来切换路径。

cd \Tesseract-Build\


3. Clone the dependencies repository from GitHub.

复制Github上的库。

git clone git://github.com/pvorb/tesseract-vs2013.git



4. Open the “VS 2013 Developer Command Prompt”. (It can be found in the Start Menu.)

打开”VS 2013 Developer Command Prompt“。(可以从开始菜单找)


5. Change to the newly cloned repository.

进入新的路径。

cd \Tesseract-Build\tesseract-vs2013


6. Build the dependencies

建立依赖关系。

msbuild build.proj


7. You can close the “VS 2013 DeveloperCommand Prompt”.

关闭”VS 2013 DeveloperCommand Prompt“。


Building Tesseract

建立tesseract工程


1. Re-open the first command prompt and ensure it’s still in C:\Tesseract-Build\.

重新打开第一个命令行,进入C:\Tesseract-Build\。


2. Get the latest source from SVN.

从SVN获取最新的资源。

svn checkout http://tesseract-ocr.googlecode.com/svn/trunk/ tesseract-ocr


3. Change to the newly checked-out repository.

进入新获取的文件夹。

cd tesseract-ocr


4. Apply the patch provided in tesseract-vs2013.

用文件夹tesseract-vs2013的文件来打补丁。

svn patch ..\tesseract-vs2013\vs2013+64bit_support.patch


5. Copy both directories in C:\Tesseract-Build\tesseract-vs2013\release\ to C:\Tesseract-Build\. Now youshould have

C:\Tesseract-Build\include\

C:\Tesseract-Build\lib\

复制C:\Tesseract-Build\tesseract-vs2013\release\下的两个文件夹到C:\Tesseract-Build\下。那么C:\Tesseract-Build\下会有include+lib文件夹。


6. Open C:\Tesseract-Build\tesseract-ocr\vs2013\tesseract.sln with Visual Studio 2013.

用VS2013打开C:\Tesseract-Build\tesseract-ocr\vs2013\tesseract.sln。


7. Press F7 on your keyboard. Both libtesseract303 and tesseract should compile without errors.

按F7。libtesseract303 、tesseract会成功编译。


    The Visual Studio solution file contains configurations for dynamic and static compilation as well as debugging and release configurations for both 32-Bit and 64-Bit. Select which ever configuration you need and recompile with F7.

    vs解决方案包括了32位和64位的静态和动态的编译、调试、发布。选择你需要的平台,重新按F7编译。


    You can find the compiled binaries in C:\Tesseract-Build\tesseract-ocr\vs2013\bin\.

    你会在C:\Tesseract-Build\tesseract-ocr\vs2013\bin\下找到编译的文件。




PS:

原文的相关评论附在以下链接。

http://blog.csdn.net/u013985291/article/details/50979178

原文评论中某用户的64位的编译好的代码:http://pan.baidu.com/s/1jGsudqI

如果想直接复制代码,最好打开原文。因为我不大会排版,怕有错。


发布了30 篇原创文章 · 获赞 8 · 访问量 4万+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章