ocr_detection(self, *args, **kwargs) Method

Invoke the OCR optical character recognition interface to return recognition text results.
Request Syntax

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

Parameters

image : Image Type, Required. A picture to be recognized with text information.

List of Codes for Supported Languages

Simplified Chinese English French German Spanish Japanese Korean Hindi
zh-chs en fr de es ja ko hi

Results Returned: OcrResult Type

Field Summary

Name Type Meaning
TextAngle Int The angle between the text to be recognized and the axis.
Status Int Status code. 0 indicates normal.
Orientation String Text orientation (UP, DOWN, LEFT, RIGHT)
Language String The identified language codes, corresponding to the table above.
Regions OcrRegion Type Array Recognized text results, including text content and information of coordinate positions.

Examples

{
    "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 "
                }
            ]
        }
    ],
    "status":0,
    "textAngle":0,
    "orientation":"UP",
    "language":"en"
}