PUT /<ObjectKey>?ci-process=IDCardOCR&CardSide=<CardSide>&Config=<Config> HTTP/1.1Host: <BucketName-APPID>.cos.<Region>.myqcloud.comDate: <GMT Date>Authorization: <Auth String>
GET /<ObjectKey>?ci-process=IDCardOCR&CardSide=<CardSide>&Config=<Config> HTTP/1.1Host: <BucketName-APPID>.cos.<Region>.myqcloud.comDate: <GMT Date>Authorization: <Auth String>
Parameter | Description | Type | Required |
ObjectKey | Object name, such as folder/document.jpg . | String | Yes |
ci-process | CI's processing capability, which is fixed at IDCardOCR for ID card recognition. | String | Yes |
CardSide | FRONT: The side of the ID card with the face (face side) BACK: The side of the ID card with the national emblem (national emblem side) If this parameter is not specified, the system will automatically determine the ID card's front and back sides. | String | No |
Config | The following fields are all of bool type and default to false: CropIdCard: Crops the ID card photo (by removing extra edges outside the ID card and automatically correcting the shooting angle) CropPortrait: Crops the face photo (by automatically cutting out the face area in the ID card) CopyWarn: Warns about photocopied images BorderCheckWarn: Warns about border and frame occlusions ReshootWarn: Warns about spoofed images DetectPsWarn: Warns about doctored images TempIdWarn: Warns about temporary ID cards InvalidDateWarn: Warns about invalid ID card validity periods Quality: Gets the image quality score (by evaluating the blurriness of the image ) MultiCardDetect: Enables multi-card detection For the parameter setting method, see Config = {"CropIdCard":true,"CropPortrait":true}. | String | No |
<Response><IdInfo>Recognized ID card information</IdInfo><AdvancedInfo>Recognized ID card information</AdvancedInfo></Response>
Node Name (Keyword) | Parent Node | Description | Type |
Response | None | Response container | Container |
Response
has the following sub-nodes:Node Name (Keyword) | Parent Node | Description | Type |
IdInfo | Response | Recognized ID card information. | Container |
AdvancedInfo | Response | Extended information, which will not be returned if not requested. | Container |
IdInfo
has the following sub-nodes:Node Name (Keyword) | Parent Node | Description | Type |
Name | IdInfo | Name (face side) | String |
Sex | IdInfo | Gender (face side) | String |
Nation | IdInfo | Ethnicity (face side) | String |
Birth | IdInfo | Date of birth (face side) | String |
Address | IdInfo | Address (face side) | String |
IdNum | IdInfo | ID number (face side) | String |
Authority | IdInfo | Issuing authority (national emblem side) | String |
ValidDate | IdInfo | Validity period (national emblem side) | String |
AdvancedInfo
has the following sub-nodes:Node Name (Keyword) | Parent Node | Description | Type |
IdCard | AdvancedInfo | Base64-encoded content of the cropped ID card photo, which will be returned if Config.CropIdCard is set to true . | String |
Portrait | AdvancedInfo | Base64-encoded content of the face on the ID card, which will be returned if Config.CropPortrait is set to true . | String |
Quality | AdvancedInfo | Image quality score, which will be returned if Config.Quality is set to true . Value range: 0–100. The lower the score, the blurrier the image. The recommended threshold is ≥ 50. | String |
BorderCodeValue | AdvancedInfo | Alarm threshold score for incomplete ID card borders, which will be returned if Config.BorderCheckWarn is set to true . Value range: 0–100. The lower the score, the lower the probability of border occlusion. The recommended threshold value is ≥ 50. | String |
WarnInfos | IdInfo | Warning information. Code values and descriptions: 9100: The ID card validity period is invalid. 9101: The ID card borders are incomplete. 9102: The ID card image is photocopied. 9103: The ID card image is spoofed. 9104: The ID card is a temporary one. 9105: The ID card frame is occluded. 9106: The ID card image is doctored. There may be multiple WarnInfos values. | String |
GET /test.jpg?ci-process=IDCardOCR&CardSide=FRONT&Config={"CropIdCard":true, "CropIdCard":true} HTTP/1.1Authorization: q-sign-algorithm=sha1&q-ak=AKIDZfbOAo7cllgPvF9cXFrJD0a1ICvR****&q-sign-time=1497530202;1497610202&q-key-time=1497530202;1497610202&q-header-list=&q-url-param-list=&q-signature=28e9a4986df11bed0255e97ff90500557e0e****Host: examplebucket-1250000000.cos.ap-beijing.myqcloud.com
HTTP/1.1 200 OKContent-Type: application/xmlContent-Length: 414641Date: Thu, 15 Jun 2017 12:37:29 GMTServer: tencent-imagex-ci-request-id: NTk0MjdmODlfMjQ4OGY3XzYzYzhf****<Response><IdInfo><Name>Li Ming</Name><Sex>Male</Sex><Nation>Han</Nation><Birth>1987/1/1</Birth><Address>Tencent Building, Hi-tech Park, Shijingshan District, Beijing</Address><IdNum>440524198701010014</IdNum></IdInfo><AdvancedInfo><IdCard>Base64-encoded content of the cropped ID card photo</IdCard><Portrait>Base64-encoded content of the face on the ID card</Portrait></AdvancedInfo></Response>
Error Code | Description |
FailedOperation.DownLoadError | Failed to download the file. |
FailedOperation.EmptyImageError | The image is empty. |
FailedOperation.IdCardInfoIllegal | The ID card information is invalid (ID number, name, etc.). |
FailedOperation.ImageBlur | The image is blurry. |
FailedOperation.ImageDecodeFailed | Failed to decode the image. |
FailedOperation.ImageNoIdCard | No ID card is detected in the image. |
FailedOperation.ImageSizeTooLarge | The image is too large. See the description of image size limit in the output parameters. |
FailedOperation.MultiCardError | There are multiple cards in the photo. |
FailedOperation.OcrFailed | OCR failed. |
FailedOperation.UnKnowError | An unknown error occurred. |
FailedOperation.UnOpenError | The service has not been activated. |
InvalidParameter.ConfigFormatError | The Config format is incorrect. |
InvalidParameterValue.InvalidParameterValueLimit | The parameter value is incorrect. |
LimitExceeded.TooLargeFileError | The file is too large. |
ResourcesSoldOut.ChargeStatusException | The billing status is abnormal. |
Was this page helpful?