拍照速算识别 API
POST
http[s]: //rest-api.xfyun.cn/v2/itr请求参数
Body 参数application/json
common
object
用于上传公共参数
app_id
string
必需
在平台申请的appid信息
business
object
用于上传业务参数
ent
string
必需
请求引擎类型,只支持math-arith
aue
string
必需
预留压缩格式,暂时只支持raw
data
object
必需
用于上传识别图像数据
image
string
必需
图像数据,base64编码,要求base64编码后大小不超过4M,最短边至少15px,最长边最大4096px,支持jpg/png/bmp格式
示例
{
"common": {
"app_id": "xxxxxxxx"
},
"business": {
"ent": "math-arith",
"aue": "raw"
},
"data": {
"image": "/9j/4AAQSkZJRgABAQAAAQABAAD/2..."
}
}
示例代码
返回响应
成功(200)
HTTP 状态码: 200
内容格式: JSONapplication/json
数据结构
code
integer
必需
返回码,0表示成功,其它表示异常,详情请参考错误码 。
message
string
描述信息
sid
string
本次会话id
data
object
必需
拍照速算识别返回信息,详见下方
ITRResult
object
必需
示例
{
"code": 0,
"message": "",
"sid": "itr0001d1af@gz16990297366463e902",
"data": {
"ITRResult": {
"attr_exception": 0,
"category": "math_phfw_arith",
"multi_line_info": {
"imp_line_info": [{
"imp_line_rect": {
"left_up_point_x": 156,
"left_up_point_y": 183,
"right_down_point_x": 416,
"right_down_point_y": 259
},
"rec_rejection": 0,
"strict_score": 0,
"total_score": 1
},
......
{
"imp_line_rect": {
"left_up_point_x": 634,
"left_up_point_y": 1303,
"right_down_point_x": 897,
"right_down_point_y": 1395
},
"rec_rejection": 0,
"strict_score": 0,
"total_score": 1
}]
},
"recog_result": [{
"line_char_result": null,
"line_word_result": [{
"beg_pos": [0],
"beg_pos_x": [0],
"beg_pos_y": [0],
"end_pos": [258],
"end_pos_x": [258],
"end_pos_y": [74],
"word_content": ["3 7 - 8 = 2 9"],
"word_gwpp": [0.9989326596260071]
},
......
{
"beg_pos": [0],
"beg_pos_x": [0],
"beg_pos_y": [0],
"end_pos": [262],
"end_pos_x": [262],
"end_pos_y": [91],
"word_content": ["7 2 - 8 = 6 4"],
"word_gwpp": [0.9990690350532532]
}]
}],
"version": "3.6.0.1022"
}
}
}
最后修改时间: 1 年前