https://github.com/leferrad/ocreract.jl
A simple Julia wrapper for Tesseract OCR
https://github.com/leferrad/ocreract.jl
julia julia-package ocr-engine wrapper-library
Last synced: 5 months ago
JSON representation
A simple Julia wrapper for Tesseract OCR
- Host: GitHub
- URL: https://github.com/leferrad/ocreract.jl
- Owner: leferrad
- License: mit
- Created: 2018-07-05T15:56:05.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-08-12T04:17:57.000Z (over 1 year ago)
- Last Synced: 2025-10-06T22:40:50.771Z (5 months ago)
- Topics: julia, julia-package, ocr-engine, wrapper-library
- Language: Julia
- Size: 792 KB
- Stars: 29
- Watchers: 1
- Forks: 9
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# OCReract.jl
*A simple Julia wrapper for Tesseract OCR*
[](https://github.com/leferrad/OCReract.jl/actions/workflows/CI.yml)
[](https://leferrad.github.io/OCReract.jl/dev)
[](https://codecov.io/gh/leferrad/OCReract.jl)
[](https://gitter.im/OCReract-jl?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
## Installation
From the Julia REPL, type `]` to enter the Pkg REPL mode and run:
```julia-repl
pkg> add OCReract
```
This is just a wrapper, so it assumes you already have installed [Tesseract](https://tesseract-ocr.github.io/tessdoc/Installation.html). Also, be sure the binary `tesseract` is in your PATH (you can check this by running `tesseract --version` in your terminal).
## Usage
This is a simple example of usage. For more details check the [Documentation](https://leferrad.github.io/OCReract.jl/dev).
```julia
julia> using Images
julia> using OCReract
julia> img_path = "/path/to/img.png";
# With a disk file
julia> run_tesseract(img_path, "/tmp/res.txt", psm=3, oem=1)
# Image in memory
julia> img = load(img_path);
julia> res_text = run_tesseract(img, psm=3, oem=1);
julia> println(strip(res_text));
```
## Testing
In a Julia session, run `Pkg.test("OCReract", coverage=true)`.
## Next steps
- Develop a module for image pre-processing (to improve OCR results)