windows vs 編譯tesseract-ocr

來源:互聯網
上載者:User

標籤:tar   https   depend   win10   uil   nload   epo   eve   this   

 

第一把肯定是要把所有相關的代碼都下載,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 tesseractcppanmkdir build && cd buildcmake ..
Windowsmaster branch, 3.05 and laterUsing 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
  1. Download the latest CPPAN (C++ Archive Network https://cppan.org/) client from https://cppan.org/client/.
  2. 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:

  1. Download the latest CPPAN (C++ Archive Network https://cppan.org/) client from https://cppan.org/client/.
  2. Run cppan --build pvt.cppan.demo.google.tesseract-master.
Develop Tesseract

For development purposes of Tesseract itself do the next steps:

  1. Download and install Git, CMake and put them in PATH.
  2. Download the latest CPPAN (C++ Archive Network https://cppan.org/) client from https://cppan.org/client/. CPPAN is a source package distribution system. Add CPPAN client in PATH too. (VS2015 redist is required.)
  3. 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
  1. Run

    cd tesseractcppanmkdir build && cd buildcmake ..
  2. 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 win64cppan ..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 source
  • tesseract-3.01-win_vs.zip - Visual studio (2008 & 2010) solution with necessary libraries
  • tesseract-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).

windows vs 編譯tesseract-ocr

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.