Skip to content
Productive and safe Rust binding for leptonica and tesseract
Rust
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci ci: fix image Jun 11, 2019
examples implement Drop for TessApi Jul 6, 2019
src implement Drop for TessApi Jul 6, 2019
tests implement Drop for TessApi Jul 6, 2019
.gitignore initial commit Jun 2, 2019
Cargo.toml implement Drop for TessApi Jul 6, 2019
LICENSE add LICENSE Jun 2, 2019
Makefile initial commit Jun 2, 2019
README.md add high level wrapper and lots of docs Jun 30, 2019
build.rs remove unused symbols Jun 16, 2019
wrapper.h initial commit Jun 2, 2019

README.md

Leptess

CircleCI Crates.io Docs

Productive and safe Rust bindings/wrappers for Tesseract and Leptonica.

Build dependencies

Make sure you have Leptonica and Tesseract installed.

For Ubuntu user:

sudo apt-get install libleptonica-dev libtesseract-dev

You will also need to install tesseract language data based on your OCR needs:

sudo apt-get install tesseract-ocr-eng

Usage

let mut lt = leptess::LepTess::new(None, "eng").unwrap();
lt.set_image("path/to/page.bmp");
println!("{}", lt.get_utf8_text().unwrap());

For more examples, see docs and examples directory.

Development

Regenerate capi binding:

make gen

To run tests, you will need at Tesseract 4.x to match what we have in tests/tessdata/eng.traineddata. See CircleCI config to see how to replicate the setup.

You can’t perform that action at this time.