ocr_detection(self, *args, **kwargs) 方法

Ocr光学字符识别接口,返回识别文本结果
request syntax

ocr_request = OcrRequest(image=image)
ocr_result = vision_client.ocr_detection(ocr_request)

parameters

image :Image 类型,必须, 待识别的带有文本信息的图片

支持的语言代号列表

简体中文 英文 法语 德语 西班牙语 日语 韩语 印地语
zh-chs en fr de es ja ko hi

返回结果: OcrResult 类型

Field Summary

name type meaning
textAngle int 待识别文字与中轴线所成的角度
statusCode int 状态码,0表示正常
orientation string 文字朝向(UP, DOWN, LEFT, RIGHT)
language string 所识别出的语言代码,对应关系见上表
regions OcrRegion 类型数组 识别出的文本结果,包括文本内容以及坐标位置信息

样例

{
    "regions":[
        {
            "boundingBox":"142,196,306,300",
            "lines":[
                {
                    "boundingBox":"237,196,164,16",
                    "text":"COMPANY NAME "
                },
                {
                    "boundingBox":"244,220,144,6",
                    "text":"SLOGAN OF THE GOES HERE "
                },
                {
                    "boundingBox":"142,441,138,14",
                    "text":"DWYANE CLARK "
                },
                {
                    "boundingBox":"184,464,95,8",
                    "text":"GRAPHIC DESIGNER "
                },
                {
                    "boundingBox":"375,479,32,6",
                    "text":"AD DRESS "
                },
                {
                    "boundingBox":"364,489,84,7",
                    "text":"LOcanON, USA "
                }
            ]
        }
    ],
    "statusCode":0,
    "textAngle":0,
    "orientation":"UP",
    "language":"en"
}

results matching ""

    No results matching ""