支持中國人民共和國護照的結構化內容檢測識別功能,支持中國內地、中國香港、中國澳門和中國臺灣地區的護照識別,識別內容包括出生地、出生日期、國籍、性別、護照號碼、有效期至、簽發國、簽發地等字段。
調試
您可以在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 內部配置變更,不影響調用 | 查看變更詳情 |