#tesseract #ocr #bindings #requires

sys tesseract-sys

Rust Bindings for Tesseract OCR

24 releases

0.6.1 Nov 4, 2023
0.6.0 Jul 11, 2023
0.5.15 Feb 26, 2023
0.5.14 Nov 10, 2022
0.1.0 Feb 25, 2017

#853 in Images

Download history 319/week @ 2024-07-27 485/week @ 2024-08-03 472/week @ 2024-08-10 430/week @ 2024-08-17 433/week @ 2024-08-24 348/week @ 2024-08-31 442/week @ 2024-09-07 275/week @ 2024-09-14 394/week @ 2024-09-21 568/week @ 2024-09-28 355/week @ 2024-10-05 304/week @ 2024-10-12 283/week @ 2024-10-19 242/week @ 2024-10-26 276/week @ 2024-11-02 152/week @ 2024-11-09

1,003 downloads per month
Used in 11 crates (4 directly)

MIT license

82KB
255 lines

tesseract-sys

Rust bindings for Tesseract. Requires version 4.1.0 or newer.

Help wanted

Windows and Mac maintainers wanted.

Building

This links to the C libraries leptonica and tesseract.

On Ubuntu and derivatives the additional dependencies can be installed by running:

sudo apt-get install libleptonica-dev libtesseract-dev clang

On Fedora 30 the additional dependencies can be installed by running:

sudo dnf install leptonica-devel tesseract-devel clang

On Termux 2019 (Android, Android on Chromebooks) the additional dependencies can be installed by running:

pkg install libclang leptonica-dev tesseract-dev

Building on Windows

On Windows, this library uses Microsoft's vcpkg to provide tesseract.

Please install vcpkg and set up user wide integration or vcpkg crate won't be able to find a library.

To install tesseract

REM from the vcpkg directory

REM 32 bit
.\vcpkg install tesseract:x86-windows

REM 64 bit
.\vcpkg install tesseract:x64-windows

vcpkg allows building either dynamically or statically linked application

if you prefer dynamic linking

SET VCPKGRS_DYNAMIC=true

for statically linked libraries

SET RUSTFLAGS=-Ctarget-feature=+crt-static

To run the tests please download the English trained data to this directory and set

SET TESSDATA_PREFIX=.

If you prefer to compile tesseract yourself (Because, for example, you could not get vcpkg to build using clang-cl.exe), you can set these environment variables: TESSERACT_INCLUDE_PATHS, TESSERACT_LINK_PATHS and TESSERACT_LINK_LIBS.

For example:

set TESSERACT_INCLUDE_PATHS=D:\tesseract\build\include
set TESSERACT_LINK_PATHS=D:\tesseract\build\lib
set TESSERACT_LINK_LIBS=tesseract41

Dependencies

~0–2MB
~38K SLoC