如何在windows上编译Tesseract OCR

如题所述

安装

  安装过程中勾选Tesseract development files:

  编译

  在安装目录中找到vs2008到工程目录:

  找到所有编译相关的库:

  打开Visual Studio 2008(没有的可以去官网下载express版本),导入工程编译。最后生成DEBUG和RELEASE两个版本的DLL:libtesseract302d.dll ,libtesseract302.dll

  在README中注意这段话:

  ?
  1
  2
  3
  4
  5
  6
  Dependencies and Licenses
  =========================
  
  Leptonica is required. (www.leptonica.com). Tesseract no longer compiles
  without Leptonica.
  Libtiff is no longer required as a direct dependency.
  Tesseract依赖Leptonica库,所以再看下Leptonica是怎么编译的。

  编译Leptonica
  Leptonica是C语言编写的一个图像处理库,支持JPEG, PNG, TIFF,GIF。

  下载

  源码:leptonica-1.68.tar.gz

  VS工程:vs2008-1.68.zip

  相关头文件和库:leptonica-1.68-win32-lib-include-dirs.zip

  编译

  把三个包解压,并按照下面的结构组建编译环境:

  ?
  1
  2
  3
  4
  5
  6
  7
  BuildFolder\
  
  include\
  
  leptonica-1.68\
  
  lib\
  BuildFolder\leptonica-1.68 contents:

  ?
  1
  2
  3
  4
  5
  6
  7
  8
  9
  10
  11
  12
  13
  14
  15
  16
  17
  config\ Not used for Windows builds
  prog\ Regression tests, examples, utilities
  src\ Source files for liblept
  vs2008\ Visual Studio 2008 specific files
  DLL Debug\ liblept DLL Debug build output
  DLL Release\ liblept DLL Release build output
  LIB Debug\ liblept LIB Debug build output
  LIB Release\ liblept LIB Release build output
  prog_projects\ Projects for prog programs
  ioformats_reg\ Sample project for prog\ioformats_reg.exe
  DLL Debug\ DLL Debug build output for sample project
  DLL Release\ DLL Release build output for sample project
  LIB Debug\ LIB Debug build output for sample project
  LIB Release\ LIB Release build output for sample project
  ioformats_reg.vcproj The ioformats_reg project file
  leptonica.sln The Leptonica solution file
  leptonica.vcproj The Leptonica project file
  打开Visual Studio 2008,导入工程编译。最后生成DEBUG和RELEASE两个版本的DLL:liblept168d.dll,liblept168.dll
温馨提示:内容为网友见解,仅供参考
第1个回答  2016-09-06
  安装
  安装过程中勾选Tesseract development files:

  编译

  在安装目录中找到vs2008到工程目录:

  找到所有编译相关的库:

  打开Visual Studio 2008(没有的可以去官网下载express版本),导入工程编译。最后生成DEBUG和RELEASE两个版本的DLL:libtesseract302d.dll ,libtesseract302.dll

  在README中注意这段话:

  ?
  1
  2
  3
  4本回答被提问者采纳
相似回答