Skip to main content

图像识别 (OCR)

API文档​

https://tech.rydeen.com.cn/apidocs/ocr/4.6.0/index.html

:::success 版本提示

该组件自4.2.0版本开始可用 :::

组件作用​

可以对图片的文字进行识别,输出识别出的文字,或者输出一张框出识别的文字后的图片 如下图

image

引入依赖​

MQTT组件配置方式如下:

首先在项目所属的Maven模块中引入组件坐标:

<dependency>
<groupId>cn.com.rydeen.component</groupId>
<artifactId>rydeen-component-ocr</artifactId>
</dependency>

使用以下方法识别图片文字

public void ocrTest() {
InferenceEngine engine = InferenceEngine.getInstance();
OcrResult ocrResult = engine.runOcr("/data/images/test.png");
}