https://tesseract-ocr.github.io/tessdoc/Compiling.html#windows

Windows

main 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.

Build the latest library (using Software Network client)

  1. Download the latest SW (Software Network https://software-network.org/) client from https://software-network.org/client/.
  2. Run sw setup (may require administrator access)
  3. Run sw build org.sw.demo.google.tesseract.tesseract.

For visual studio project using tesseract

  1. Setup Vcpkg the Visual C++ Package Manager.
  2. Run vcpkg install tesseract:x64-windows for 64-bit. Use –head for the master branch.

Static linking

To build a self-contained tesseract.exe executable (without any DLLs or runtime dependencies), use Vcpkg as above with the following command:

  • vcpkg install tesseract:x64-windows-static for 64-bit
  • vcpkg install tesseract:x86-windows-static for 32-bit

Use –head for the main branch. It may still require one DLL for the OpenMP runtime, vcomp140.dll (which you can find in the Visual C++ Redistributable 2015).

Build training tools

Today it is possible to build a full set of tess training tools on Windows with Visual Studio. You need to have the latest VS compiler (VS2019/2022 or light VS 2019/2022 build tools distro installed.

To do this:

  1. Download the latest SW (Software Network https://software-network.org/client/) client from https://software-network.org/client/.
  2. Checkout tesseract sources git clone https://github.com/tesseract-ocr/tesseract tesseract && cd tesseract.
  3. Run sw build.
  4. Binaries will be available under .sw\out\some hash dir...

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 SW (Software Network https://software-network.org/) client from https://software-network.org/client/. SW is a source package distribution system.
  3. Add SW client to PATH.
  4. Run sw setup (may require administrator access)
  5. If you have a release archive, unpack it to tesseract dir.

If you’re using main branch run

   git clone https://github.com/tesseract-ocr/tesseract tesseract
  1. Run

     cd tesseract
     mkdir build && cd build
     cmake ..
    
  2. Build a solution (tesseract.sln) in your Visual Studio version. If you want to build and install from command line (e.g. Release build) you can use this command:

    cmake --build . --config Release --target install
    

    If you want to install to other directory that C:\Program Files (you will need admin right for this), you need to specify install path during configuration:

    cmake .. -G "Visual Studio 15 2017 Win64" -DCMAKE_INSTALL_PREFIX=inst
    

For development purposes of training tools after cloning a repo from previous paragraph, run

sw build

You’ll see a solution link appeared in the root directory of Tesseract.

 

 

https://tesseract-ocr.github.io/tessdoc/Compiling.html

https://github.com/tesseract-ocr/tesseract?tab=readme-ov-file

posted @ 2024-02-22 00:57  fire909090  阅读(69)  评论(0编辑  收藏  举报