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萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章