No description
Find a file
Davide Galilei a315d45e3e
Merge pull request #3 from brainwo/master
Update README usage
2022-10-23 09:38:35 +02:00
.vscode First working version of the library 2022-01-04 16:54:30 +01:00
assets Changed banner size (it was too big) 2022-01-04 17:38:34 +01:00
examples Removed options 2022-01-04 17:16:05 +01:00
src Removed options 2022-01-04 17:16:05 +01:00
tests Removed options 2022-01-04 17:16:05 +01:00
.gitignore First attempt 2022-01-03 14:23:47 +01:00
LICENSE First working version of the library 2022-01-04 16:54:30 +01:00
nimtesseract.nimble Changed license in Nimble file 2022-01-04 17:39:45 +01:00
README.md fix typo 2022-10-23 15:34:04 +08:00

Nim Tesseract 👑👁

banner Nim Tesseract is a Nim wrapper for the Tesseract OCR library, via its dynamic library.

Installation 👇

$ nimble install nimtesseract

Usage 🌷

  1. Install (lib)tesseract via your package manager or put the tesseract so/dll/dylib file in the project directory E.g. for Arch Linux:
$ pacman -Sy tesseract

for macOS:

$ brew install tesseract
  1. Download trained data from https://github.com/tesseract-ocr/tessdata or https://github.com/tesseract-ocr/tessdata_fast
  2. Done

Example 🤔

import nimtesseract

echo imageToText("file.png")

More examples in the examples folder

Development 🔩

Download trained data and put it into src folder

⚠️ Outdated, but still useful. Don't refer to this.

$ cd src
$ TESSDATA_PREFIX=$(pwd) nim r -d:pixieUseStb nimtesseract.nim

Run tests with nimble:

$ nimble test

capi.h reference: https://github.com/tesseract-ocr/tesseract/blob/main/include/tesseract/capi.h

Credits 👻

Inspired from https://github.com/Altabeh/tesseract-ocr-wrapper

License 📕

This project is under the Unlicense license. This is free and unencumbered software released into the public domain.