本文介绍外卖单识别RecognizeTakeoutOrder的语法及示例。
功能描述
外卖单识别能力可以识别外卖单上的关键字段内容,输出商店名称、电话、包装费、配送费、商品合计、其他费用合计、顾客优惠合计、总件数、在线支付、订单编号、下单时间等。目前支持饿了么外卖单。
前提条件
输入限制
- 图像格式:JPEG、JPG、PNG。
- 图像大小:不超过10M。
- 图像分辨率:不限制图片分辨率,但是分辨率太高可能会导致API推理超时,推理超时时间为5秒。
- URL地址中不能包含中文字符。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求参数
名称 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | RecognizeTakeoutOrder |
要执行的操作。取值:RecognizeTakeoutOrder。 |
ImageURL | String | 是 | https://viapi-test.oss-cn-shanghai.aliyuncs.com/test-team/takeoutorder.jpg |
图像URL地址。当前仅支持上海地域的OSS链接,如何生成URL请参见生成URL。 |
返回数据
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
Data | Struct |
返回的结果数据内容。 |
|
Elements | Array of Element |
识别出的外卖单具体内容。 |
|
Boxes | List | [2177, 2082, 2321, 2152] |
字段位置框信息,格式为[左上角点X轴坐标,左上角点Y轴坐标,右上角点X轴坐标,右上角点Y轴坐标]。 |
Name | String | delivery_fee |
外卖单上关键字段。包括:
|
Score | Float | 0.68 |
识别出的字段信息的置信度。 |
Value | String | 4.00 |
具体字段对应的内容。 |
RequestId | String | 3068BB25-663A-4BEC-9481-B970FFA5256C |
请求ID。 |
示例
请求示例
http(s)://ocr.cn-shanghai.aliyuncs.com/?Action=RecognizeTakeoutOrder
&ImageURL=https://viapi-test.oss-cn-shanghai.aliyuncs.com/test-team/takeoutorder.jpg
&<公共请求参数>
正常返回示例
XML
格式
<RequestId>3068BB25-663A-4BEC-9481-B970FFA5256C</RequestId>
<Data>
<Elements>
<Score>0.9974356293678284</Score>
<Value>4.00</Value>
<Name>delivery_fee</Name>
<Boxes>2190</Boxes>
<Boxes>2022</Boxes>
<Boxes>2337</Boxes>
<Boxes>2098</Boxes>
</Elements>
<Elements>
<Score>0.9995468854904175</Score>
<Value>36.00</Value>
<Name>online_pay</Name>
<Boxes>2157</Boxes>
<Boxes>2531</Boxes>
<Boxes>2340</Boxes>
<Boxes>2616</Boxes>
</Elements>
<Elements>
<Score>0.9989166855812073</Score>
<Value>3056887498797982898</Value>
<Name>order_number</Name>
<Boxes>1597</Boxes>
<Boxes>3653</Boxes>
<Boxes>2310</Boxes>
<Boxes>3755</Boxes>
</Elements>
<Elements>
<Score>0.9980564713478088</Score>
<Value>12-1720:25</Value>
<Name>order_time</Name>
<Boxes>1598</Boxes>
<Boxes>3762</Boxes>
<Boxes>2015</Boxes>
<Boxes>3853</Boxes>
</Elements>
<Elements>
<Score>0.9959266781806946</Score>
<Value>0.00</Value>
<Name>packaging_fee</Name>
<Boxes>2187</Boxes>
<Boxes>1934</Boxes>
<Boxes>2336</Boxes>
<Boxes>2010</Boxes>
</Elements>
<Elements>
<Score>0.9957205653190613</Score>
<Value>越峰便利店(鲁迅中路店)</Value>
<Name>shop_name</Name>
<Boxes>1260</Boxes>
<Boxes>847</Boxes>
<Boxes>1996</Boxes>
<Boxes>924</Boxes>
</Elements>
<Elements>
<Score>0.9995644092559814</Score>
<Value>13588503737</Value>
<Name>telephone_number</Name>
<Boxes>1258</Boxes>
<Boxes>925</Boxes>
<Boxes>1625</Boxes>
<Boxes>991</Boxes>
</Elements>
<Elements>
<Score>0.9992033243179321</Score>
<Value>-2.00</Value>
<Name>total_benefits</Name>
<Boxes>2159</Boxes>
<Boxes>2366</Boxes>
<Boxes>2336</Boxes>
<Boxes>2439</Boxes>
</Elements>
<Elements>
<Score>0.9994907975196838</Score>
<Value>34.00</Value>
<Name>total_goods</Name>
<Boxes>2157</Boxes>
<Boxes>2189</Boxes>
<Boxes>2339</Boxes>
<Boxes>2270</Boxes>
</Elements>
<Elements>
<Score>0.9997580051422119</Score>
<Value>3</Value>
<Name>total_number</Name>
<Boxes>1520</Boxes>
<Boxes>2530</Boxes>
<Boxes>1564</Boxes>
<Boxes>2612</Boxes>
</Elements>
<Elements>
<Score>0.9937386512756348</Score>
<Value>4.00</Value>
<Name>total_other</Name>
<Boxes>2191</Boxes>
<Boxes>2281</Boxes>
<Boxes>2337</Boxes>
<Boxes>2353</Boxes>
</Elements>
</Data>
JSON
格式
{
"RequestId": "3068BB25-663A-4BEC-9481-B970FFA5256C",
"Data": {
"Elements": [
{
"Score": "0.9974356293678284",
"Value": "4.00",
"Name": "delivery_fee",
"Boxes": [
2190,
2022,
2337,
2098
]
},
{
"Score": "0.9995468854904175",
"Value": "36.00",
"Name": "online_pay",
"Boxes": [
2157,
2531,
2340,
2616
]
},
{
"Score": "0.9989166855812073",
"Value": "3056887498797982898",
"Name": "order_number",
"Boxes": [
1597,
3653,
2310,
3755
]
},
{
"Score": "0.9980564713478088",
"Value": "12-1720:25",
"Name": "order_time",
"Boxes": [
1598,
3762,
2015,
3853
]
},
{
"Score": "0.9959266781806946",
"Value": "0.00",
"Name": "packaging_fee",
"Boxes": [
2187,
1934,
2336,
2010
]
},
{
"Score": "0.9957205653190613",
"Value": "越峰便利店(鲁迅中路店)",
"Name": "shop_name",
"Boxes": [
1260,
847,
1996,
924
]
},
{
"Score": "0.9995644092559814",
"Value": "13588503737",
"Name": "telephone_number",
"Boxes": [
1258,
925,
1625,
991
]
},
{
"Score": "0.9992033243179321",
"Value": "-2.00",
"Name": "total_benefits",
"Boxes": [
2159,
2366,
2336,
2439
]
},
{
"Score": "0.9994907975196838",
"Value": "34.00",
"Name": "total_goods",
"Boxes": [
2157,
2189,
2339,
2270
]
},
{
"Score": "0.9997580051422119",
"Value": "3",
"Name": "total_number",
"Boxes": [
1520,
2530,
1564,
2612
]
},
{
"Score": "0.9937386512756348",
"Value": "4.00",
"Name": "total_other",
"Boxes": [
2191,
2281,
2337,
2353
]
}
]
}
}
错误码
关于外卖单识别的错误码,详情请参见常见错误码。
SDK参考
阿里云视觉AI能力支持使用SDK调用,具体可参见SDK总览下载安装。
安全声明
- 请确保上传的图片或文件来源符合相应的法律法规。
- 通过体验调试上传的临时文件有效期为1小时,在24小时后会被系统自动清理删除。
在文档使用中是否遇到以下问题
更多建议
匿名提交