文档

RecognizeFoodProduceLicense - 食品生产许可证识别

更新时间:

食品生产许可证识别。

接口说明

本接口适用场景

  • 阿里云食品生产许可证识别,是阿里云官方自研 OCR 文字识别产品。适用于识别食品生产许可证社会信用代码、发证机关、生产地址、签发日期等信息的场景。
  • 阿里云 OCR 产品基于阿里巴巴达摩院强大的 AI 技术及海量数据,历经多年沉淀打磨,具有服务稳定、操作简易、实时性高、能力全面等几大优势。
  • 本接口图片示例

本接口核心能力

分类概述
图像增强默认支持图像增强,包括图像自动旋转、畸变自动矫正、模糊图片自动增强等能力。
多类型覆盖支持模糊、光照不均、透视畸变、任意背景等低质量图像识别。
高精度识别总体识别准确率可达 98%。

如何使用本接口

步骤概述
1开通 企业资质识别 服务。开通服务前后,您可以通过体验馆免费体验本功能识别效果。
2购买 企业资质识别资源包。本 API 会赠送免费额度,可使用免费额度测试。您也可以不购买资源包,系统会通过“按量付费”方式按实际调用量自动扣款。
3可以参照调试页面提供的代码示例完成 API 接入开发。接入完成后,调用 API 获取识别结果。如果使用子账号调用接口,需要阿里云账号(主账号)对 RAM 账号进行授权。创建 RAM 用户的具体操作,请参考:创建 RAM 用户。文字识别服务提供一种系统授权策略,即 AliyunOCRFullAccess。具体授权操作,请参见在用户页面为 RAM 用户授权。

重要提示

类型概述
图片格式
  • 本接口支持:PNG、JPG、JPEG、BMP、GIF、TIFF、WebP。暂不支持 PDF 格式。
图片尺寸
  • 图片长宽需要大于 15 像素,小于 8192 像素。
  • 长宽比需要小于 50。
  • 如需达到较好识别效果,建议长宽均大于 500px。
  • 图片尺寸过小,会影响识别精度。图片内单字大小在 10-50px 内时,识别效果较好。
图片大小
  • 图片二进制文件不能超过 10MB。
  • 图片过大会影响接口响应速度,建议使用小于 1.5M 图片进行识别,且通过传图片 URL 的方式调用接口。

调试

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

授权信息

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

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

请求参数

名称类型必填描述示例值
Urlstring
  • 本字段和 body 字段二选一,不可同时透传或同时为空。
  • 图片链接(长度不超 2048,不支持 base64)。
https://img.alicdn.com/tfs/TB1YaMhXKT2gK0jSZFvXXXnFXXa-1414-1000.png
bodybyte
  • 本字段和 URL 字段二选一,不可同时透传或同时为空。
  • 图片二进制文件,最大 10MB。
  • 使用 HTTP 方式调用,把图片二进制文件放到 HTTP body 中上传即可。
  • 使用 SDK 的方式调用,把图片放到 SDK 的 body 中即可。
图片二进制文件

返回参数

名称类型描述示例值
object

Schema of Response

RequestIdstring

请求唯一 ID

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

返回数据

{ "data": { "producerName": "中山市华夏中药饮片有限公司", "creditCode": "", "legalRepresentative": "杨文君", "officeAddress": "广东省中山市火恒开发区雅和南路3号", "productionAddress": "广东省中山市火炬开发区雅柏南路3号", "foodType": "水果制品(水果制品):水产制品(非即食其他食品(汤料)***", "licenceNumber": "SC11644200000389", "regulatoryAuthority": "中山市食品药品监督管理局", "regulatoryPersonnel": "由日常监督管理机构指定", "reportHotline": "12331", "issueAuthority": "中山市食品药品监督管理局", "issueOfficer": "徐世平", "issueDate": "201603", "validToDate": "2021年03月06日" }, "ftype": 1, "height": 1000, "orgHeight": 1000, "orgWidth": 1414, "prism_keyValueInfo": [{ "key": "producerName", "keyProb": 100, "value": "中山市华夏中药饮片有限公司", "valuePos": [{ "x": 586, "y": 313 }, { "x": 586, "y": 338 }, { "x": 321, "y": 338 }, { "x": 321, "y": 313 }], "valueProb": 100 }, { "key": "creditCode", "keyProb": 100, "value": "", "valueProb": 100 }, { "key": "legalRepresentative", "keyProb": 100, "value": "杨文君", "valuePos": [{ "x": 381, "y": 418 }, { "x": 381, "y": 438 }, { "x": 328, "y": 438 }, { "x": 328, "y": 418 }], "valueProb": 100 }, { "key": "officeAddress", "keyProb": 98, "value": "广东省中山市火恒开发区雅和南路3号", "valuePos": [{ "x": 319, "y": 453 }, { "x": 584, "y": 452 }, { "x": 584, "y": 472 }, { "x": 319, "y": 473 }], "valueProb": 98 }, { "key": "productionAddress", "keyProb": 100, "value": "广东省中山市火炬开发区雅柏南路3号", "valuePos": [{ "x": 602, "y": 498 }, { "x": 602, "y": 540 }, { "x": 322, "y": 540 }, { "x": 322, "y": 498 }], "valueProb": 100 }, { "key": "foodType", "keyProb": 99, "value": "水果制品(水果制品):水产制品(非即食其他食品(汤料)***", "valuePos": [{ "x": 324, "y": 578 }, { "x": 613, "y": 576 }, { "x": 614, "y": 640 }, { "x": 325, "y": 642 }], "valueProb": 99 }, { "key": "licenceNumber", "keyProb": 100, "value": "SC11644200000389", "valuePos": [{ "x": 1058, "y": 316 }, { "x": 1058, "y": 336 }, { "x": 890, "y": 336 }, { "x": 890, "y": 316 }], "valueProb": 100 }, { "key": "regulatoryAuthority", "keyProb": 100, "value": "中山市食品药品监督管理局", "valuePos": [{ "x": 889, "y": 357 }, { "x": 1133, "y": 357 }, { "x": 1133, "y": 382 }, { "x": 889, "y": 382 }], "valueProb": 100 }, { "key": "regulatoryPersonnel", "keyProb": 100, "value": "由日常监督管理机构指定", "valuePos": [{ "x": 1116, "y": 413 }, { "x": 1116, "y": 437 }, { "x": 891, "y": 437 }, { "x": 891, "y": 413 }], "valueProb": 100 }, { "key": "reportHotline", "keyProb": 100, "value": "12331", "valuePos": [{ "x": 1037, "y": 495 }, { "x": 1037, "y": 515 }, { "x": 917, "y": 515 }, { "x": 917, "y": 495 }], "valueProb": 100 }, { "key": "issueAuthority", "keyProb": 100, "value": "中山市食品药品监督管理局", "valuePos": [{ "x": 894, "y": 535 }, { "x": 1137, "y": 535 }, { "x": 1137, "y": 557 }, { "x": 894, "y": 557 }], "valueProb": 100 }, { "key": "issueOfficer", "keyProb": 100, "value": "徐世平", "valuePos": [{ "x": 891, "y": 615 }, { "x": 957, "y": 613 }, { "x": 958, "y": 638 }, { "x": 892, "y": 640 }], "valueProb": 100 }, { "key": "issueDate", "keyProb": 100, "value": "201603", "valuePos": [{ "x": 959, "y": 668 }, { "x": 959, "y": 684 }, { "x": 847, "y": 684 }, { "x": 847, "y": 668 }], "valueProb": 100 }, { "key": "validToDate", "keyProb": 100, "value": "2021年03月06日", "valuePos": [{ "x": 235, "y": 740 }, { "x": 421, "y": 739 }, { "x": 422, "y": 754 }, { "x": 236, "y": 756 }], "valueProb": 100 }], "sliceRect": { "x0": 94, "y0": 119, "x1": 1305, "y1": 120, "x2": 1307, "y2": 927, "x3": 95, "y3": 934 }, "width": 1414 }
Codestring

状态码

200
Messagestring

详细信息

message

返回参数说明


字段类型说明
dataobject结构化信息。
sliceRectlist检测出的子图坐标信息。
prism_keyValueInfolist结构化信息的坐标信息。
ftypeint是否为复印件(1:是,0:否)。
codeslist二维码信息。
heightint算法矫正图片后的高度。
widthint算法矫正图片后的宽度。
orgHeightint原图的高度。
orgWidthint原图的宽度。

结构化信息(data 字段)

字段类型说明
producerNamestring生产者名称。
creditCodestring社会信用代码(身份证号码)。
legalRepresentativestring法定代表人(负责人)。
officeAddressstring住所。
productionAddressstring生产地址。
foodTypestring食品类别。
licenceNumberstring许可证编号。
regulatoryAuthoritystring日常监督管理机构。
regulatoryPersonnelstring日常监督管理人员。
reportHotlinestring投诉举报电话。
issueAuthoritystring发证机关。
issueOfficerstring签发人。
issueDatestring签发日期。
validToDatestring有效期至。

结构化坐标信息(prism_keyValueInfo 字段)

字段类型说明
keystring识别出的字段名称。
keyProbint字段名称置信度。
valuestring识别出的字段名称对应的值。
valueProbint字段名称对应值的置信度。
valuePoslist字段在原图中的四个点坐标(左上、右上、右下、左下)。

二维码信息(codes 字段)

字段类型说明
datastring二维码地址。
typestring二维码类型。
pointslist二维码四个点坐标(左上、右上、右下、左下)。

示例

正常返回示例

JSON格式

{
  "RequestId": "43A29C77-405E-4CC0-BC55-EE694AD00655",
  "Data": "{ \t\"data\": { \t\t\"producerName\": \"中山市华夏中药饮片有限公司\", \t\t\"creditCode\": \"\", \t\t\"legalRepresentative\": \"杨文君\", \t\t\"officeAddress\": \"广东省中山市火恒开发区雅和南路3号\", \t\t\"productionAddress\": \"广东省中山市火炬开发区雅柏南路3号\", \t\t\"foodType\": \"水果制品(水果制品):水产制品(非即食其他食品(汤料)***\", \t\t\"licenceNumber\": \"SC11644200000389\", \t\t\"regulatoryAuthority\": \"中山市食品药品监督管理局\", \t\t\"regulatoryPersonnel\": \"由日常监督管理机构指定\", \t\t\"reportHotline\": \"12331\", \t\t\"issueAuthority\": \"中山市食品药品监督管理局\", \t\t\"issueOfficer\": \"徐世平\", \t\t\"issueDate\": \"201603\", \t\t\"validToDate\": \"2021年03月06日\" \t}, \t\"ftype\": 1, \t\"height\": 1000, \t\"orgHeight\": 1000, \t\"orgWidth\": 1414, \t\"prism_keyValueInfo\": [{ \t\t\"key\": \"producerName\", \t\t\"keyProb\": 100, \t\t\"value\": \"中山市华夏中药饮片有限公司\", \t\t\"valuePos\": [{ \t\t\t\"x\": 586, \t\t\t\"y\": 313 \t\t}, { \t\t\t\"x\": 586, \t\t\t\"y\": 338 \t\t}, { \t\t\t\"x\": 321, \t\t\t\"y\": 338 \t\t}, { \t\t\t\"x\": 321, \t\t\t\"y\": 313 \t\t}], \t\t\"valueProb\": 100 \t}, { \t\t\"key\": \"creditCode\", \t\t\"keyProb\": 100, \t\t\"value\": \"\", \t\t\"valueProb\": 100 \t}, { \t\t\"key\": \"legalRepresentative\", \t\t\"keyProb\": 100, \t\t\"value\": \"杨文君\", \t\t\"valuePos\": [{ \t\t\t\"x\": 381, \t\t\t\"y\": 418 \t\t}, { \t\t\t\"x\": 381, \t\t\t\"y\": 438 \t\t}, { \t\t\t\"x\": 328, \t\t\t\"y\": 438 \t\t}, { \t\t\t\"x\": 328, \t\t\t\"y\": 418 \t\t}], \t\t\"valueProb\": 100 \t}, { \t\t\"key\": \"officeAddress\", \t\t\"keyProb\": 98, \t\t\"value\": \"广东省中山市火恒开发区雅和南路3号\", \t\t\"valuePos\": [{ \t\t\t\"x\": 319, \t\t\t\"y\": 453 \t\t}, { \t\t\t\"x\": 584, \t\t\t\"y\": 452 \t\t}, { \t\t\t\"x\": 584, \t\t\t\"y\": 472 \t\t}, { \t\t\t\"x\": 319, \t\t\t\"y\": 473 \t\t}], \t\t\"valueProb\": 98 \t}, { \t\t\"key\": \"productionAddress\", \t\t\"keyProb\": 100, \t\t\"value\": \"广东省中山市火炬开发区雅柏南路3号\", \t\t\"valuePos\": [{ \t\t\t\"x\": 602, \t\t\t\"y\": 498 \t\t}, { \t\t\t\"x\": 602, \t\t\t\"y\": 540 \t\t}, { \t\t\t\"x\": 322, \t\t\t\"y\": 540 \t\t}, { \t\t\t\"x\": 322, \t\t\t\"y\": 498 \t\t}], \t\t\"valueProb\": 100 \t}, { \t\t\"key\": \"foodType\", \t\t\"keyProb\": 99, \t\t\"value\": \"水果制品(水果制品):水产制品(非即食其他食品(汤料)***\", \t\t\"valuePos\": [{ \t\t\t\"x\": 324, \t\t\t\"y\": 578 \t\t}, { \t\t\t\"x\": 613, \t\t\t\"y\": 576 \t\t}, { \t\t\t\"x\": 614, \t\t\t\"y\": 640 \t\t}, { \t\t\t\"x\": 325, \t\t\t\"y\": 642 \t\t}], \t\t\"valueProb\": 99 \t}, { \t\t\"key\": \"licenceNumber\", \t\t\"keyProb\": 100, \t\t\"value\": \"SC11644200000389\", \t\t\"valuePos\": [{ \t\t\t\"x\": 1058, \t\t\t\"y\": 316 \t\t}, { \t\t\t\"x\": 1058, \t\t\t\"y\": 336 \t\t}, { \t\t\t\"x\": 890, \t\t\t\"y\": 336 \t\t}, { \t\t\t\"x\": 890, \t\t\t\"y\": 316 \t\t}], \t\t\"valueProb\": 100 \t}, { \t\t\"key\": \"regulatoryAuthority\", \t\t\"keyProb\": 100, \t\t\"value\": \"中山市食品药品监督管理局\", \t\t\"valuePos\": [{ \t\t\t\"x\": 889, \t\t\t\"y\": 357 \t\t}, { \t\t\t\"x\": 1133, \t\t\t\"y\": 357 \t\t}, { \t\t\t\"x\": 1133, \t\t\t\"y\": 382 \t\t}, { \t\t\t\"x\": 889, \t\t\t\"y\": 382 \t\t}], \t\t\"valueProb\": 100 \t}, { \t\t\"key\": \"regulatoryPersonnel\", \t\t\"keyProb\": 100, \t\t\"value\": \"由日常监督管理机构指定\", \t\t\"valuePos\": [{ \t\t\t\"x\": 1116, \t\t\t\"y\": 413 \t\t}, { \t\t\t\"x\": 1116, \t\t\t\"y\": 437 \t\t}, { \t\t\t\"x\": 891, \t\t\t\"y\": 437 \t\t}, { \t\t\t\"x\": 891, \t\t\t\"y\": 413 \t\t}], \t\t\"valueProb\": 100 \t}, { \t\t\"key\": \"reportHotline\", \t\t\"keyProb\": 100, \t\t\"value\": \"12331\", \t\t\"valuePos\": [{ \t\t\t\"x\": 1037, \t\t\t\"y\": 495 \t\t}, { \t\t\t\"x\": 1037, \t\t\t\"y\": 515 \t\t}, { \t\t\t\"x\": 917, \t\t\t\"y\": 515 \t\t}, { \t\t\t\"x\": 917, \t\t\t\"y\": 495 \t\t}], \t\t\"valueProb\": 100 \t}, { \t\t\"key\": \"issueAuthority\", \t\t\"keyProb\": 100, \t\t\"value\": \"中山市食品药品监督管理局\", \t\t\"valuePos\": [{ \t\t\t\"x\": 894, \t\t\t\"y\": 535 \t\t}, { \t\t\t\"x\": 1137, \t\t\t\"y\": 535 \t\t}, { \t\t\t\"x\": 1137, \t\t\t\"y\": 557 \t\t}, { \t\t\t\"x\": 894, \t\t\t\"y\": 557 \t\t}], \t\t\"valueProb\": 100 \t}, { \t\t\"key\": \"issueOfficer\", \t\t\"keyProb\": 100, \t\t\"value\": \"徐世平\", \t\t\"valuePos\": [{ \t\t\t\"x\": 891, \t\t\t\"y\": 615 \t\t}, { \t\t\t\"x\": 957, \t\t\t\"y\": 613 \t\t}, { \t\t\t\"x\": 958, \t\t\t\"y\": 638 \t\t}, { \t\t\t\"x\": 892, \t\t\t\"y\": 640 \t\t}], \t\t\"valueProb\": 100 \t}, { \t\t\"key\": \"issueDate\", \t\t\"keyProb\": 100, \t\t\"value\": \"201603\", \t\t\"valuePos\": [{ \t\t\t\"x\": 959, \t\t\t\"y\": 668 \t\t}, { \t\t\t\"x\": 959, \t\t\t\"y\": 684 \t\t}, { \t\t\t\"x\": 847, \t\t\t\"y\": 684 \t\t}, { \t\t\t\"x\": 847, \t\t\t\"y\": 668 \t\t}], \t\t\"valueProb\": 100 \t}, { \t\t\"key\": \"validToDate\", \t\t\"keyProb\": 100, \t\t\"value\": \"2021年03月06日\", \t\t\"valuePos\": [{ \t\t\t\"x\": 235, \t\t\t\"y\": 740 \t\t}, { \t\t\t\"x\": 421, \t\t\t\"y\": 739 \t\t}, { \t\t\t\"x\": 422, \t\t\t\"y\": 754 \t\t}, { \t\t\t\"x\": 236, \t\t\t\"y\": 756 \t\t}], \t\t\"valueProb\": 100 \t}], \t\"sliceRect\": { \t\t\"x0\": 94, \t\t\"y0\": 119, \t\t\"x1\": 1305, \t\t\"y1\": 120, \t\t\"x2\": 1307, \t\t\"y2\": 927, \t\t\"x3\": 95, \t\t\"y3\": 934 \t}, \t\"width\": 1414 }",
  "Code": "200",
  "Message": "message"
}

错误码

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

变更历史

变更时间变更内容概要操作
2021-08-17OpenAPI 入参发生变更看变更集
变更项变更内容
入参OpenAPI 入参发生变更
    新增入参:body
  • 本页导读 (0)
文档反馈