analyzeBitmap

abstract fun analyzeBitmap(bitmap: Bitmap, regionBuilder: Rect.() -> Unit?): OcrResults

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

Return

返回包含所有识别结果的容器对象 OcrResults,每个结果中包含文本、位置、置信度等信息。

Parameters

bitmap

图像Bitmap对象

regionBuilder

可选的 DSL 区域构造器,用于限定识别区域(通过设置 Rect 的四个边界)。若为 null,则识别整张图像。 示例:{ left = 100; top = 200; right = 400; bottom = 600 }