接入指引
请先查看接入指引了解具体接入方式,再参考此文档完成接入。
请求API
名称 | 内容 |
---|
请求方式 | POST |
Content-Type | application/x-www-form-urlencoded |
图片要求 | 1. 图片格式:JPG、JPEG、PNG、BMP等常见格式,建议使用JPG格式。 2. 图片文件大小:最大 5 MB。 |
输入参数
Query参数:
参数 | 可选/必选 | 类型 | 说明 |
---|
Action | 必选 | String | 接口名,取值:OcrSeal |
Version | 必选 | String | 版本号,取值:2021-08-23 |
Body参数:
参数 | 可选/必选 | 类型 | 说明 |
---|
image_base64 | 必选 | String | 图片base64编码 |
data 字段说明
字段 | 类型 | 说明 | 备注 |
---|
seal_infos | Array of seal_info | 检测到的每一个印章信息 | 字段说明见下方 |
seal_info 字段说明
字段 | 类型 | 说明 | 备注 |
---|
seal_type | String | 印章类型 | seal_noise(不完整印章)/normal_seal(圆形印章)/ellipse_seal(椭圆印章) |
seal_color | String | 印章颜色 | red(红章)/blue(蓝章)/black(黑白章) |
curve_text | String | 曲文 | 主页信息 |
curve_text_poly | Array of points | 曲文位置 | 外接多边形 |
plain_text_1 | String | 税号 | 主页信息 |
plain_text_1_poly | Array of points | 税号位置 | 外接多边形 |
plain_text_2 | String | 专用章类型 | 主页信息 |
plain_text_2_poly | Array of points | 专用章类型位置 | 外接多边形 |
poly | Array of points | 印章位置 | 印章的bbox角点 [左上,右上,右下,左下] |
HttpCode | 错误码 | 错误消息 | 描述 |
---|
200 | 10000 | 无 | 请求成功 |
400 | 60103 | "Missing Input Parameters: empty input image" | 输入图片为空 |
400 | 60301 | "Invalid Input Image: get input image error" | 获取图片错误 |
400 | 61301 | "Invalid Input Parameters: Input image can not be decoded" | 输入图片错误 |
返回值示例
主页面图片返回值示例
{
"code":10000,
"data":{
"seal_infos":[
{
"seal_type":"ellipse_seal",
"seal_color":"red",
"curve_text":"宁波迅途信息技术有限公司",
"curve_text_poly":[
[641, 454], [641, 461], [655, 461], [656, 459], [657, 446], [661, 436], [665, 433], [675, 425], [682, 423], [697, 419], [722, 419], [740, 426], [749, 434], [756, 441], [758, 447], [758, 457], [760, 461], [772, 459], [773, 447], [771, 439], [764, 426], [753, 416], [745, 412], [730, 407], [717, 403], [706, 403], [679, 408], [659, 418], [651, 426], [646, 434], [642, 445]
]
"plain_text_1":"913302820629019631",
"plain_text_1_poly":[
[661, 447], [661, 458], [663, 459], [753, 459], [754, 458], [753, 457], [753, 446], [753, 446], [663, 446]
]
"plain_text_2":"发票专用章",
"plain_text_2_poly":[
674, 470], [675, 471], [675, 476], [674, 476], [674, 485], [675, 486], [679, 486], [679, 485], [739, 485], [740, 484], [740, 482], [740, 481], [740, 476], [740, 476], [740, 471], [740, 471], [740, 469], [739, 469], [675, 469], [675, 470]
]
"poly":[
[636, 399], [780, 399], [780, 506], [636, 506]
]
},
]
},
"message":"Success",
"request_id":"68465821727368171521594094134",
"time_elapsed":"509.475088ms"
}