RecognizeBusShipTicket - 客运车船票识别

支持包括标题、发票号码、出发车站、到达车站、日期、金额等关键字段结构化识别输出。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

授权信息

下表是API对应的授权信息,可以在RAM权限策略语句的Action元素中使用,用来给RAM用户或RAM角色授予调用此API的权限。具体说明如下:

  • 操作:是指具体的权限点。
  • 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。
  • 资源类型:是指操作中支持授权的资源类型。具体说明如下:
    • 对于必选的资源类型,用背景高亮的方式表示。
    • 对于不支持资源级授权的操作,用全部资源表示。
  • 条件关键字:是指云产品自身定义的条件关键字。
  • 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。
操作访问级别资源类型条件关键字关联操作
ocr:RecognizeBusShipTicketget
*全部资源
*

请求参数

名称类型必填描述示例值
Urlstring

图片链接(长度不超 2048 字节,不支持 base64)

https://img.alicdn.com/imgextra/i2/O1CN010iDcM7218ZQJtJyGX_!!6000000006940-0-tps-936-541.jpg
bodybyte

图片二进制字节流,最大 10MB

图片二进制

支持的图片格式

  • PNG、JPG、JPEG、BMP、GIF、TIFF、WebP

返回参数

名称类型描述示例值
object

Schema of Response

RequestIdstring

请求唯一 ID

43A29C77-405E-4CC0-BC55-EE694AD00655
Datastring

返回数据

{"angle":0,"data":{"title":"南通汽运实业集团有限公司旅客运输专用发票","formType":"发票联","invoiceCode":"132061981313","invoiceNumber":"05591493","date":"2020-01-20","time":"12:30","departureStation":"南通东站","arrivalStation":"上海总站","totalAmount":"56.00","passengerName":"颜跃第","idcardNo":"3210****2218"},"ftype":0,"height":541,"orgHeight":541,"orgWidth":936,"prism_keyValueInfo":[{"key":"title","keyProb":97,"value":"南通汽运实业集团有限公司旅客运输专用发票","valuePos":[{"x":508,"y":16},{"x":509,"y":94},{"x":91,"y":95},{"x":90,"y":18}],"valueProb":98},{"key":"formType","keyProb":100,"value":"发票联","valuePos":[{"x":388,"y":119},{"x":388,"y":157},{"x":209,"y":157},{"x":209,"y":118}],"valueProb":100},{"key":"invoiceCode","keyProb":100,"value":"132061981313","valuePos":[{"x":929,"y":127},{"x":929,"y":161},{"x":699,"y":162},{"x":698,"y":128}],"valueProb":100},{"key":"invoiceNumber","keyProb":100,"value":"05591493","valuePos":[{"x":851,"y":167},{"x":851,"y":199},{"x":696,"y":201},{"x":695,"y":168}],"valueProb":100},{"key":"date","keyProb":100,"value":"2020-01-20","valuePos":[{"x":185,"y":356},{"x":186,"y":384},{"x":62,"y":385},{"x":62,"y":358}],"valueProb":100},{"key":"time","keyProb":100,"value":"12:30","valuePos":[{"x":186,"y":385},{"x":186,"y":358},{"x":264,"y":359},{"x":264,"y":386}],"valueProb":100},{"key":"departureStation","keyProb":100,"value":"南通东站","valuePos":[{"x":66,"y":304},{"x":66,"y":271},{"x":187,"y":274},{"x":186,"y":308}],"valueProb":100},{"key":"arrivalStation","keyProb":100,"value":"上海总站","valuePos":[{"x":205,"y":306},{"x":205,"y":273},{"x":326,"y":276},{"x":325,"y":308}],"valueProb":100},{"key":"totalAmount","keyProb":100,"value":"56.00","valuePos":[{"x":402,"y":278},{"x":402,"y":306},{"x":366,"y":306},{"x":366,"y":278}],"valueProb":100},{"key":"passengerName","keyProb":97,"value":"颜跃第","valuePos":[{"x":426,"y":466},{"x":427,"y":434},{"x":516,"y":435},{"x":516,"y":468}],"valueProb":97},{"key":"idcardNo","keyProb":100,"value":"3210****2218","valuePos":[{"x":729,"y":441},{"x":729,"y":468},{"x":548,"y":468},{"x":548,"y":441}],"valueProb":100}],"sliceRect":{"x0":0,"y0":14,"x1":934,"y1":18,"x2":936,"y2":541,"x3":0,"y3":541},"width":936}
Codestring

错误码

noPermission
Messagestring

错误提示

You are not authorized to perform this operation.

中英文字段映射

data    结构化信息
prism_keyValueInfo    结构化信息的坐标信息
sliceRect    图片中身份证子图区域的任意四边形表示,起始点为左上角,顺序为顺时针
ftype    是否是复印件(1:是,0:否)
  • data 内字段说明
title    标题
formType    发票联次
invoiceCode    发票代码
invoiceNumber    发票号码
date    日期
time    时间
departureStation    出发车站
arrivalStation    到达车站
totalAmount    总金额
passengerName    姓名
idcardNo    身份证号
  • prism_keyValueInfo 数组字段说明
key    识别出的字段名称
keyProb    字段名称置信度
value    识别出的字段名称对应的值
valueProb    字段名称对应值的置信度
valuePos    字段在原图中的四个点坐标(左上、右上、右下、左下)

示例

正常返回示例

JSON格式

{
  "RequestId": "43A29C77-405E-4CC0-BC55-EE694AD00655",
  "Data": "{\"angle\":0,\"data\":{\"title\":\"南通汽运实业集团有限公司旅客运输专用发票\",\"formType\":\"发票联\",\"invoiceCode\":\"132061981313\",\"invoiceNumber\":\"05591493\",\"date\":\"2020-01-20\",\"time\":\"12:30\",\"departureStation\":\"南通东站\",\"arrivalStation\":\"上海总站\",\"totalAmount\":\"56.00\",\"passengerName\":\"颜跃第\",\"idcardNo\":\"3210****2218\"},\"ftype\":0,\"height\":541,\"orgHeight\":541,\"orgWidth\":936,\"prism_keyValueInfo\":[{\"key\":\"title\",\"keyProb\":97,\"value\":\"南通汽运实业集团有限公司旅客运输专用发票\",\"valuePos\":[{\"x\":508,\"y\":16},{\"x\":509,\"y\":94},{\"x\":91,\"y\":95},{\"x\":90,\"y\":18}],\"valueProb\":98},{\"key\":\"formType\",\"keyProb\":100,\"value\":\"发票联\",\"valuePos\":[{\"x\":388,\"y\":119},{\"x\":388,\"y\":157},{\"x\":209,\"y\":157},{\"x\":209,\"y\":118}],\"valueProb\":100},{\"key\":\"invoiceCode\",\"keyProb\":100,\"value\":\"132061981313\",\"valuePos\":[{\"x\":929,\"y\":127},{\"x\":929,\"y\":161},{\"x\":699,\"y\":162},{\"x\":698,\"y\":128}],\"valueProb\":100},{\"key\":\"invoiceNumber\",\"keyProb\":100,\"value\":\"05591493\",\"valuePos\":[{\"x\":851,\"y\":167},{\"x\":851,\"y\":199},{\"x\":696,\"y\":201},{\"x\":695,\"y\":168}],\"valueProb\":100},{\"key\":\"date\",\"keyProb\":100,\"value\":\"2020-01-20\",\"valuePos\":[{\"x\":185,\"y\":356},{\"x\":186,\"y\":384},{\"x\":62,\"y\":385},{\"x\":62,\"y\":358}],\"valueProb\":100},{\"key\":\"time\",\"keyProb\":100,\"value\":\"12:30\",\"valuePos\":[{\"x\":186,\"y\":385},{\"x\":186,\"y\":358},{\"x\":264,\"y\":359},{\"x\":264,\"y\":386}],\"valueProb\":100},{\"key\":\"departureStation\",\"keyProb\":100,\"value\":\"南通东站\",\"valuePos\":[{\"x\":66,\"y\":304},{\"x\":66,\"y\":271},{\"x\":187,\"y\":274},{\"x\":186,\"y\":308}],\"valueProb\":100},{\"key\":\"arrivalStation\",\"keyProb\":100,\"value\":\"上海总站\",\"valuePos\":[{\"x\":205,\"y\":306},{\"x\":205,\"y\":273},{\"x\":326,\"y\":276},{\"x\":325,\"y\":308}],\"valueProb\":100},{\"key\":\"totalAmount\",\"keyProb\":100,\"value\":\"56.00\",\"valuePos\":[{\"x\":402,\"y\":278},{\"x\":402,\"y\":306},{\"x\":366,\"y\":306},{\"x\":366,\"y\":278}],\"valueProb\":100},{\"key\":\"passengerName\",\"keyProb\":97,\"value\":\"颜跃第\",\"valuePos\":[{\"x\":426,\"y\":466},{\"x\":427,\"y\":434},{\"x\":516,\"y\":435},{\"x\":516,\"y\":468}],\"valueProb\":97},{\"key\":\"idcardNo\",\"keyProb\":100,\"value\":\"3210****2218\",\"valuePos\":[{\"x\":729,\"y\":441},{\"x\":729,\"y\":468},{\"x\":548,\"y\":468},{\"x\":548,\"y\":441}],\"valueProb\":100}],\"sliceRect\":{\"x0\":0,\"y0\":14,\"x1\":934,\"y1\":18,\"x2\":936,\"y2\":541,\"x3\":0,\"y3\":541},\"width\":936}",
  "Code": "noPermission",
  "Message": "You are not authorized to perform this operation."
}

错误码

访问错误中心查看更多错误码。