支持中国人民共和国护照的结构化内容检测识别功能,支持中国内地、中国香港、中国澳门和中国台湾地区的护照识别,识别内容包括出生地、出生日期、国籍、性别、护照号码、有效期至、签发国、签发地等字段。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
授权信息
下表是API对应的授权信息,可以在RAM权限策略语句的Action
元素中使用,用来给RAM用户或RAM角色授予调用此API的权限。具体说明如下:
- 操作:是指具体的权限点。
- 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。
- 资源类型:是指操作中支持授权的资源类型。具体说明如下:
- 对于必选的资源类型,用背景高亮的方式表示。
- 对于不支持资源级授权的操作,用
全部资源
表示。
- 条件关键字:是指云产品自身定义的条件关键字。
- 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。
操作 | 访问级别 | 资源类型 | 条件关键字 | 关联操作 |
---|---|---|---|---|
ocr:RecognizeChinesePassport | get |
|
| 无 |
请求参数
名称 | 类型 | 必填 | 描述 | 示例值 |
---|---|---|---|---|
Url | string | 否 | 图片链接(长度不超 2048 字节,不支持 base64) | https://img.alicdn.com/imgextra/i1/O1CN01UNXHMC1FJTGRkdCgT_!!6000000000466-0-tps-1500-1125.jpg |
body | byte | 否 | 图片二进制字节流,最大 10MB | 图片二进制 |
OutputFigure | boolean | 否 | 是否需要图案检测功能,默认需要 | true |
返回参数
返回数据说明
passportType 证件类型
countryCode 国家码
passportNumber 护照号码
nameEn 英文姓名
name 中文姓名
sex 性别
birthPlace 出生地
nationality 国籍
issuePlace 签发地
issueAuthority 签发机关
mrzLine1 机读码一
mrzLine2 机读码二
validToDate 有效期至
birthDate 出生日期
issueDate 签发日期
height 算法矫正图片后的高度
width 算法矫正图片后的宽度
orgHeight 原图的高度
orgWidth 原图的宽度
----------------------------------------prism_keyValueInfo 文字块数组内的字段说明---------------------------------------
valuePos 外矩形四个点的坐标按顺时针排列,左上、右上、右下、左下
示例
正常返回示例
JSON
格式
{
"RequestId": "43A29C77-405E-4CC0-BC55-EE694AD00655",
"Data": "{\"algo_server\": [\"ocr_doctype_v9963/prism?src=test&op=doctype&pro=basic,rotate,split_kv_server&scene=multi_invoice&requestid=7F1D8C92-A3F9-566A-ABC7-A3AED0C8EC14\", \"ocr_tail_card_v9827/prism?src=sub_img_json&op=passport_chn&pro=basic,qrcode,key_eng,split_kv_server&requestid=7F1D8C92-A3F9-566A-ABC7-A3AED0C8EC14\"], \"algo_version\": \"2375eb78d7d5bdaa14f65f4597d87dcca1a833bf;3acc43ec9464ac9c8741236069021029b72f2a37\", \"data\": {\"birthDate\": \"2000.04.17\", \"birthPlace\": \"北京/BEIJING\", \"countryCode\": \"CHN\", \"issueAuthority\": \"公安部出入境管理局\", \"issueDate\": \"2018.08.15\", \"issuePlace\": \"北京/BEIJING\", \"mrzLine1\": \"POCHNDU<<XIAOGUANG<<<<<<<<<<<<<<<<<<<<<<<<<<\", \"mrzLine2\": \"EE12345678CHN8108038F2110189NGKELMPONBPJB978\", \"name\": \"读小光\", \"nameEn\": \"DU,XIAOGUANG\", \"nationality\": \"中国/CHINESE\", \"passportNumber\": \"EE1234567\", \"passportType\": \"P\", \"sex\": \"女/F\", \"validToDate\": \"2028.08.14\"}, \"debug_info\": {\"kv_info\": [{\"det_cfd\": 0.666085, \"det_cls\": 0, \"det_pts\": [458.850006, 140.850006, 484.149994, 140.850006, 484.149994, 174.149994, 458.850006, 174.149994], \"rec_cfd\": 0.99997, \"rec_tcc\": \"P\"}, {\"det_cfd\": 0.582849, \"det_cls\": 1, \"det_pts\": [668.5, 141.5, 757.5, 141.5, 757.5, 174.5, 668.5, 174.5], \"rec_cfd\": 0.999993, \"rec_tcc\": \"CHN\"}, {\"det_cfd\": 0.692661, \"det_cls\": 2, \"det_pts\": [979.150024, 154.149994, 1149.849976, 154.149994, 1149.849976, 194.849976, 979.150024, 194.849976], \"rec_cfd\": 0.999925, \"rec_tcc\": \"EE1234567\"}, {\"det_cfd\": 0.639483, \"det_cls\": 4, \"det_pts\": [478.25, 242.25, 579.75, 242.25, 579.75, 280.75, 478.25, 280.75], \"rec_cfd\": 0.999972, \"rec_tcc\": \"读小光\"}, {\"det_cfd\": 0.625903, \"det_cls\": 3, \"det_pts\": [480.450012, 287.450012, 734.549988, 287.450012, 734.549988, 321.549988, 480.450012, 321.549988], \"rec_cfd\": 0.999911, \"rec_tcc\": \"DUXIAOGUANG\"}, {\"det_cfd\": 0.789848, \"det_cls\": 5, \"det_pts\": [472.450012, 387.450012, 549.549988, 387.450012, 549.549988, 421.549988, 472.450012, 421.549988], \"rec_cfd\": 0.999883, \"rec_tcc\": \"女/F\"}, {\"det_cfd\": 0.618615, \"det_cls\": 7, \"det_pts\": [613.307129, 386.292847, 855.849365, 387.307678, 855.692871, 424.707031, 613.150635, 423.6922], \"rec_cfd\": 0.999966, \"rec_tcc\": \"中国/CHINESE\"}, {\"det_cfd\": 0.736546, \"det_cls\": 17, \"det_pts\": [914.549988, 388.549988, 955.450012, 388.549988, 955.450012, 420.450012, 914.549988, 420.450012], \"rec_cfd\": 0.999938, \"rec_tcc\": \"17\"}, {\"det_cfd\": 0.866409, \"det_cls\": 16, \"det_pts\": [975.599976, 388.600006, 1047.400024, 388.600006, 1047.400024, 419.399994, 975.599976, 419.399994], \"rec_cfd\": 0.999989, \"rec_tcc\": \"APR\"}, {\"det_cfd\": 0.588426, \"det_cls\": 15, \"det_pts\": [1069.449951, 385.450012, 1149.550049, 385.450012, 1149.550049, 419.549988, 1069.449951, 419.549988], \"rec_cfd\": 0.99974, \"rec_tcc\": \"2000\"}, {\"det_cfd\": 0.717915, \"det_cls\": 6, \"det_pts\": [476.290985, 463.308655, 673.515198, 462.286743, 673.709045, 499.691406, 476.484772, 500.713318], \"rec_cfd\": 0.999593, \"rec_tcc\": \"北京/BEIJING\"}, {\"det_cfd\": 0.696412, \"det_cls\": 20, \"det_pts\": [914.599976, 477.600006, 956.400024, 477.600006, 956.400024, 508.399994, 914.599976, 508.399994], \"rec_cfd\": 0.999846, \"rec_tcc\": \"15\"}, {\"det_cfd\": 0.623998, \"det_cls\": 19, \"det_pts\": [969.733093, 476.48288, 1108.511353, 477.510834, 1108.266968, 510.517181, 969.488586, 509.489227], \"rec_cfd\": 0.999963, \"rec_tcc\": \"8月/AUG\"}, {\"det_cfd\": 0.72265, \"det_cls\": 18, \"det_pts\": [1120.549927, 477.549988, 1207.449829, 477.549988, 1207.449829, 509.450012, 1120.549927, 509.450012], \"rec_cfd\": 0.999741, \"rec_tcc\": \"2018\"}, {\"det_cfd\": 0.543882, \"det_cls\": 8, \"det_pts\": [478.291351, 560.308289, 682.691772, 559.291321, 682.877808, 596.695862, 478.477448, 597.71283], \"rec_cfd\": 0.96807, \"rec_tcc\": \"北京/BEIJING\"}, {\"det_cfd\": 0.846068, \"det_cls\": 14, \"det_pts\": [913.650024, 568.650024, 952.349976, 568.650024, 952.349976, 598.349976, 913.650024, 598.349976], \"rec_cfd\": 0.999887, \"rec_tcc\": \"14\"}, {\"det_cfd\": 0.746095, \"det_cls\": 13, \"det_pts\": [966.549988, 568.549988, 1103.449951, 568.549988, 1103.449951, 600.450012, 966.549988, 600.450012], \"rec_cfd\": 0.999923, \"rec_tcc\": \"8月/AUG\"}, {\"det_cfd\": 0.720334, \"det_cls\": 12, \"det_pts\": [1118.5, 567.5, 1205.5, 567.5, 1205.5, 600.5, 1118.5, 600.5], \"rec_cfd\": 0.999701, \"rec_tcc\": \"2028\"}, {\"det_cfd\": 0.736712, \"det_cls\": 9, \"det_pts\": [472.228668, 654.359924, 760.644104, 653.347961, 760.771423, 689.643616, 472.356049, 690.655579], \"rec_cfd\": 0.99993, \"rec_tcc\": \"公安部出入境管理局\"}, {\"det_cfd\": 0.473612, \"det_cls\": 10, \"det_pts\": [116.688416, 805.592896, 1116.404297, 808.604126, 1116.311523, 839.407104, 116.595642, 836.395874], \"rec_cfd\": 0.999298, \"rec_tcc\": \"POCHNZHENGJIAN<<YANGBEN<<<<<<<<<<<<<<<<<<<\"}, {\"det_cfd\": 0.73551, \"det_cls\": 11, \"det_pts\": [106.353485, 864.346741, 1088.720825, 866.355652, 1088.646606, 902.653259, 106.279266, 900.644348], \"rec_cfd\": 0.989609, \"rec_tcc\": \"E900000821CHN8108038F2110189NGKELMPONBPJB978\"}]}, \"ftype\": 0, \"height\": 1125, \"orgHeight\": 1125, \"orgWidth\": 1500, \"prism_keyValueInfo\": [{\"key\": \"passportType\", \"keyProb\": 100, \"value\": \"P\", \"valuePos\": [{\"x\": 458, \"y\": 140}, {\"x\": 484, \"y\": 140}, {\"x\": 484, \"y\": 174}, {\"x\": 458, \"y\": 174}], \"valueProb\": 100}, {\"key\": \"countryCode\", \"keyProb\": 100, \"value\": \"CHN\", \"valuePos\": [{\"x\": 668, \"y\": 141}, {\"x\": 757, \"y\": 141}, {\"x\": 757, \"y\": 174}, {\"x\": 668, \"y\": 174}], \"valueProb\": 100}, {\"key\": \"passportNumber\", \"keyProb\": 100, \"value\": \"EE1234567\", \"valuePos\": [{\"x\": 979, \"y\": 154}, {\"x\": 1149, \"y\": 154}, {\"x\": 1149, \"y\": 194}, {\"x\": 979, \"y\": 194}], \"valueProb\": 100}, {\"key\": \"nameEn\", \"keyProb\": 100, \"value\": \"DU,XIAOGUANG\", \"valuePos\": [{\"x\": 480, \"y\": 287}, {\"x\": 734, \"y\": 287}, {\"x\": 734, \"y\": 321}, {\"x\": 480, \"y\": 321}], \"valueProb\": 100}, {\"key\": \"name\", \"keyProb\": 100, \"value\": \"读小光\", \"valuePos\": [{\"x\": 478, \"y\": 242}, {\"x\": 579, \"y\": 242}, {\"x\": 579, \"y\": 280}, {\"x\": 478, \"y\": 280}], \"valueProb\": 100}, {\"key\": \"sex\", \"keyProb\": 100, \"value\": \"女/F\", \"valuePos\": [{\"x\": 472, \"y\": 387}, {\"x\": 549, \"y\": 387}, {\"x\": 549, \"y\": 421}, {\"x\": 472, \"y\": 421}], \"valueProb\": 100}, {\"key\": \"birthPlace\", \"keyProb\": 100, \"value\": \"北京/BEIJING\", \"valuePos\": [{\"x\": 475, \"y\": 463}, {\"x\": 673, \"y\": 462}, {\"x\": 673, \"y\": 498}, {\"x\": 476, \"y\": 500}], \"valueProb\": 100}, {\"key\": \"nationality\", \"keyProb\": 100, \"value\": \"中国/CHINESE\", \"valuePos\": [{\"x\": 612, \"y\": 387}, {\"x\": 855, \"y\": 386}, {\"x\": 855, \"y\": 422}, {\"x\": 613, \"y\": 424}], \"valueProb\": 100}, {\"key\": \"issuePlace\", \"keyProb\": 97, \"value\": \"北京/BEIJING\", \"valuePos\": [{\"x\": 477, \"y\": 560}, {\"x\": 682, \"y\": 559}, {\"x\": 682, \"y\": 595}, {\"x\": 478, \"y\": 597}], \"valueProb\": 97}, {\"key\": \"issueAuthority\", \"keyProb\": 100, \"value\": \"公安部出入境管理局\", \"valuePos\": [{\"x\": 471, \"y\": 654}, {\"x\": 760, \"y\": 652}, {\"x\": 760, \"y\": 688}, {\"x\": 472, \"y\": 689}], \"valueProb\": 100}, {\"key\": \"mrzLine1\", \"keyProb\": 100, \"value\": \"POCHNDU<<XIAOGUANG<<<<<<<<<<<<<<<<<<<<<<<<<<\", \"valuePos\": [{\"x\": 115, \"y\": 808}, {\"x\": 1116, \"y\": 805}, {\"x\": 1116, \"y\": 835}, {\"x\": 116, \"y\": 839}], \"valueProb\": 100}, {\"key\": \"mrzLine2\", \"keyProb\": 99, \"value\": \"EE12345678CHN8108038F2110189NGKELMPONBPJB978\", \"valuePos\": [{\"x\": 105, \"y\": 866}, {\"x\": 1087, \"y\": 863}, {\"x\": 1088, \"y\": 899}, {\"x\": 106, \"y\": 901}], \"valueProb\": 99}, {\"key\": \"validToDate\", \"keyProb\": 100, \"value\": \"2028.08.14\", \"valuePos\": [{\"x\": 1796, \"y\": 567}, {\"x\": 2310, \"y\": 567}, {\"x\": 2310, \"y\": 596}, {\"x\": 1796, \"y\": 596}], \"valueProb\": 100}, {\"key\": \"birthDate\", \"keyProb\": 100, \"value\": \"2000.04.17\", \"valuePos\": [{\"x\": 1803, \"y\": 386}, {\"x\": 2205, \"y\": 385}, {\"x\": 2206, \"y\": 415}, {\"x\": 1804, \"y\": 417}], \"valueProb\": 100}, {\"key\": \"issueDate\", \"keyProb\": 100, \"value\": \"2018.08.15\", \"valuePos\": [{\"x\": 1802, \"y\": 478}, {\"x\": 2313, \"y\": 478}, {\"x\": 2313, \"y\": 514}, {\"x\": 1802, \"y\": 514}], \"valueProb\": 100}], \"sliceRect\": {\"x0\": 58, \"x1\": 1476, \"x2\": 1467, \"x3\": 49, \"y0\": 65, \"y1\": 78, \"y2\": 1056, \"y3\": 1067}, \"width\": 1500}",
"Code": "noPermission",
"Message": "You are not authorized to perform this operation."
}
错误码
访问错误中心查看更多错误码。
变更历史
变更时间 | 变更内容概要 | 操作 |
---|---|---|
2022-11-25 | API 内部配置变更,不影响调用 | 查看变更详情 |