TesseractOcrConfig

Tesseract OCR 专用配置接口,扩展了基础 OCR 配置功能。 提供添加自定义训练数据、初始化 Tesseract OCR 引擎以及管理配置的方法,支持特定语言或多语言识别。

该接口用于配置 Tesseract OCR 引擎,支持加载自定义语言模型(*.traineddata 文件), 指定识别语言和 OCR 引擎模式,并管理已初始化的 API 配置和训练数据。 适用于需要高精度或特定领域文字识别的场景,例如文档扫描、验证码识别、票据处理等。

See also

基础 OCR 配置接口

Samples

com.m8test.ocr.samples.TesseractConfigSample

Functions

Link copied to clipboard
abstract fun addTrainedData(file: String)

添加 Tesseract 训练数据文件,用于指定语言的文字识别。

Link copied to clipboard
abstract fun setApi(language: String, ocrEngineMode: Int)

初始化 Tesseract OCR 引擎,指定识别语言和 OCR 引擎模式。