Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jeenyuhs/vesseract
A V wrapper for Tesseract-OCR
https://github.com/jeenyuhs/vesseract
ocr tesseract v wrapper
Last synced: about 1 month ago
JSON representation
A V wrapper for Tesseract-OCR
- Host: GitHub
- URL: https://github.com/jeenyuhs/vesseract
- Owner: jeenyuhs
- License: mit
- Created: 2021-11-04T21:56:30.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2021-11-14T20:58:14.000Z (about 3 years ago)
- Last Synced: 2024-05-19T05:27:39.743Z (7 months ago)
- Topics: ocr, tesseract, v, wrapper
- Language: V
- Homepage:
- Size: 3.27 MB
- Stars: 18
- Watchers: 1
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-v - vesseract - V wrapper for Tesseract-OCR (optical character recognition). (Libraries / Command line interface (CLI) / Terminal / Shell)
README
# Vesseract
A "WIP" V wrapper for Tesseract-OCR inspired by pytesseract wrapper!
Tesseract OCR is a optical character recognition software made by Google,
it can "read" text from an image.You need to install Tesseract 4 and register it in your path.
Install the package from VPM:
```
v install barrack-obama.vesseract
```
# Quickstart```v
import barrack-obama.vesseract// Extract text from image
// Image: path - lang: Language for tesseract - args: custom arguments
text := vesseract.image_to_string(
image: 'sample/demo.png', lang: 'eng', args: '') or {
panic(err)
}
// Or simply: vesseract.image_to_string_path('sample/demo.png')
// "Got: Hi from Vesseract !"
println("Got: $text")// Get Tesseract version
version := vesseract.get_tesseract_version() or { panic(err) }
// 4.1.0 installed: "Tesseract 4 - 1 - 0 detected!"
println("Tesseract $version.major - $version.minor - $version.patch detected!")// Get languages supported by Tesseract
langs := vesseract.get_languages() or { panic(err) }
// Example: "['afr', 'amh', 'ara', 'asm', ... 'uzb_cyrl', 'vie', 'yid', 'yor']"
println("$langs")// Get alto xml - Require Tesseract >4.1.0
alto := vesseract.image_to_alto_xml_path('sample/demo.png') or { panic(err) }
// "XML: ... "
println("XML: $alto")// Get bounding boxes for letters
boxes := image_to_boxes(image: 'sample/demo.png', lang: 'eng', args: '') or { panic(err) }
println("$boxes")
/* "[.Tesseract_box{
letter: 'H'
x1: 68
y1: 206
x2: 91
y2: 235
page: 0
}, ... "// Check if a language model exists in Tesseract
if (vesseract.is_language_code_supported("fra")) {
// Do stuff...
} else {
// Use another model instead...
}```
# LicenseThis wrapper is licensed under the MIT License, see ```LICENSE``` for details