Ocr

interface Ocr : ScriptCloseable

OCR(光学字符识别)核心接口,定义统一的文本识别能力。 实现类可提供从图像文件或当前屏幕截图中提取文字及其位置信息的功能。

See also

ScriptCloseable

用于释放识别器所占用的资源。

Inheritors

Functions

Link copied to clipboard
abstract fun analyzeImage(image: String, regionBuilder: Rect.() -> Unit?): OcrResults

对指定图像文件执行文本识别。

Link copied to clipboard
abstract fun analyzeImageText(image: String, regionBuilder: Rect.() -> Unit?): String

对指定图像文件执行文本识别。

Link copied to clipboard
abstract fun analyzeScreen(regionBuilder: Rect.() -> Unit?): OcrResults

对当前屏幕截图执行文本识别(自动申请必要的截图权限)。

Link copied to clipboard
abstract fun analyzeScreenText(regionBuilder: Rect.() -> Unit?): String

对当前屏幕截图执行文本识别(自动申请必要的截图权限)。

Link copied to clipboard
abstract override fun close()
Link copied to clipboard
abstract fun getContext(): ScriptContext
Link copied to clipboard
abstract fun isClosed(): Boolean