#ocr #tesseract

sys tesseract-sys

Rust Bindings for Tesseract OCR

22 releases

0.5.15 Feb 26, 2023
0.5.14 Nov 10, 2022
0.5.13 Oct 1, 2022
0.5.12 Feb 6, 2022
0.1.0 Feb 25, 2017

#406 in Images

Download history 201/week @ 2023-02-08 350/week @ 2023-02-15 390/week @ 2023-02-22 516/week @ 2023-03-01 764/week @ 2023-03-08 338/week @ 2023-03-15 306/week @ 2023-03-22 280/week @ 2023-03-29 244/week @ 2023-04-05 231/week @ 2023-04-12 175/week @ 2023-04-19 302/week @ 2023-04-26 292/week @ 2023-05-03 332/week @ 2023-05-10 301/week @ 2023-05-17 157/week @ 2023-05-24

1,101 downloads per month
Used in 7 crates (2 directly)

MIT license

157 lines


Rust bindings for Tesseract. Requires version 4.1.0 or newer.


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


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


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


~33K SLoC