OcrEngine
scalacv.OcrEngine
trait OcrEngine
A pluggable OCR engine.
scalacv owns the OpenCV half of OCR — the grayscale → denoise → threshold → deskew preprocessing that makes or breaks recognition (image.forOcr) — and this contract. The engine is yours to supply, because Tesseract (and the cloud OCRs) are heavy, separately-licensed native dependencies that do not belong in a thin OpenCV wrapper. Implementing it is a few lines over tess4j or bytedeco's tesseract preset — see the OCR guide.
val engine: OcrEngine = myTesseractEngine
val text = Image.read("scan.jpg").map(img => try Ocr.read(img, engine).text finally img.close())
Attributes
- Source
- Ocr.scala
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
Members list
In this article