文字识别 OCR-网络图片识别:响应示例

时间:2024-04-15 09:41:19

响应示例

状态码:200

成功响应示例

{
  "result" : {
    "extracted_data" : {
      "contact_info" : {
        "name" : "张三",
        "phone" : "13112345678",
        "province" : "广东省",
        "city" : "深圳市",
        "district" : "龙岗区",
        "detail_address" : "五和大道华为D区"
      },
      "image_size" : {
        "height" : 480,
        "width" : 640
      }
    },
    "words_block_count" : 2,
    "words_block_list" : [ {
      "words" : "收件人:张三,联系电话:13112345678,收件地址:广东省深圳市龙岗区五和大道华为D区",
      "confidence" : 0.9188,
      "location" : [ [ 13, 476 ], [ 91, 332 ], [ 125, 351 ], [ 48, 494 ] ],
      "font_list" : [ "黑体", "Arial", "华文中宋体", "微软正黑粗体", "文泉驿等宽正黑体" ],
      "font_scores" : [ 0.36, 0.2761, 0.2117, 0.0616, 0.0606 ]
    }, {
      "words" : "方正字体",
      "confidence" : 0.8631,
      "location" : [ [ 13, 476 ], [ 91, 332 ], [ 125, 351 ], [ 48, 494 ] ],
      "font_list" : [ "方正铭石体", "方正黑简体", "文泉驿等宽正黑体", "腾祥孔淼石头简体", "微软正黑粗体" ],
      "font_scores" : [ 0.9999, 0.0, 0.0, 0.0, 0.0 ]
    } ]
  }
}

状态码:400

失败响应示例

{
    "error_code": "AIS.0103", 
    "error_msg": "The image size does not meet the requirements." 
}
support.huaweicloud.com/api-ocr/ocr_03_0108.html