开发者社区> 问答> 正文

人工智能图像类API参考 车牌识别方法?



本页面主要介绍服务对应的接口和返回结果中的关键字段的含义,请在阅读本页面之前,了解 请求数据格式介绍,了解输入输出的通用数据格式。 此外,在本页最后,附上了车牌识别服务调用的程序示例,以供参考。

请求接口

  • 云市场接口请求方法: POST
  • 请求url: 在云市场搜索印刷文字识别-车牌识别,在API接口中找到调用地址


请求参数

参数名称参数类型描述默认值
imagestringdataType为50, dataValue是base64编码后的图像数据空字符串
configurestringdataType为50, dataValue是json字符串,仅包含一个字段,”multi_crop”,值类型为布尔型.空字符串

POST请求body 示例如下:<divre style='background: rgb(246, 246, 246); font: 12px/1.6 "YaHei Consolas Hybrid", Consolas, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Helvetica, monospace, monospace; margin: 0px 0px 16px; padding: 10px; outline: 0px; border-radius: 3px; border: 1px solid rgb(221, 221, 221); overflow: auto; white-space: pre-wrap; word-wrap: break-word; box-sizing: border-box; font-size-adjust: none; font-stretch: normal;' prettyprinted?="" linenums="">
  1. {
  2.     "inputs": [
  3.     {
  4.         "image": {
  5.             "dataType": 50,                         #50表示image的数据类型为字符串
  6.             "dataValue": "base64_image_string"      #图片以base64编码的string
  7.         }
  8.         "configure": {
  9.             "dataType": 50
  10.             "dataValue": "{\"multi_crop\":false}"  #optional, 当设成true时,会做多crop预测,只有当多crop返回的结果一致,并且置信度>0.9时,才返回结果
  11.     }]
  12. }


返回结果格式


返回结果格式如下:<divre style='background: rgb(246, 246, 246); font: 12px/1.6 "YaHei Consolas Hybrid", Consolas, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Helvetica, monospace, monospace; margin: 0px 0px 16px; padding: 10px; outline: 0px; border-radius: 3px; border: 1px solid rgb(221, 221, 221); overflow: auto; white-space: pre-wrap; word-wrap: break-word; box-sizing: border-box; font-size-adjust: none; font-stretch: normal;' prettyprinted?="" linenums="">
  1. #使用multicrop,仅仅返回高置信度的情况
  2. {
  3.     "outputs": [
  4.     {
  5.         "outputLabel": "ocr_vehicle_plate",
  6.         "outputMulti": {},
  7.         "outputValue": {
  8.             "dataType": 50,
  9.             "dataValue":"{
  10.                           \"config_str\":\"{\\\"multi_crop\\\":true}\",
  11.                           \"plates\":[
  12.                             {
  13.                               \"detail\":\"冀AA617A,0.99753#冀AA617A,0.997782#冀AA617A,0.999783#冀AA617A,0.999999\",
  14.                               \"prob\":0.99752956628799438,
  15.                               \"roi\":{\"h\":35,\"w\":90,\"x\":17,\"y\":21},
  16.                               \"txt\":\"冀AA617A\"
  17.                             }
  18.                           ],
  19.                           \"success\":true
  20.                         }
  21.         }
  22.     }]
  23. }
  24. #不使用multicrop,使用单个模型预测
  25. {
  26.     "outputs": [
  27.     {
  28.         "outputLabel": "ocr_vehicle_plate",
  29.         "outputMulti": {},
  30.         "outputValue": {
  31.             "dataType": 50,
  32.             "dataValue":"{
  33.                           \"config_str\":\"{}\",
  34.                           \"plates\":[
  35.                             {
  36.                               \"detail\":\"\",
  37.                               \"prob\":0.99999260902404785,
  38.                               \"roi\":{\"h\":43,\"w\":100,\"x\":14,\"y\":20},
  39.                               \"txt\":\"津KQ2300\"
  40.                             }
  41.                           ],
  42.                           \"success\":true
  43.                          }"
  44.         }
  45.     }]
  46. }

每一个请求返回的结果都是一个json字符串,由dataValue关键词可以索引到,主要有如下字段:
  • config_str: 表示发送请求时候的配置字符串,为json字符串格式,表示输入时候的配置参数, 类型为字符串
  • detail: 当config_str里面multi_crop设成true时,给出多个模型的预测结果,供参考
  • roi: 车牌的大概位置
  • txt: 车牌号
  • prob: 识别概率
  • success: 识别流程是否出现异常, false表示识别失败,true表示识别成功, 类型为布尔型

展开
收起
nicenelly 2017-10-26 10:53:21 2053 0
0 条回答
写回答
取消 提交回答
问答排行榜
最热
最新

相关电子书

更多
【云栖精选6月刊】当AI来敲门,一刊尽览人工智能 立即下载
人工智能的商业化落地 立即下载
人工智能的投资机会 立即下载