To make a face image standardization check, the check_icao method is used, which evaluates if the face photo quality matches the ISO/IEC 19794-5, ICAO norm. This standard was created to allow machines to make face images analysis automatically with more efficiency, thus, verifying that the photo being sent to the system complies with this standard will enhance your usage of BioPass ID.

For the request body, insert a text in JSON format containing the base64 string of the image you want to check. An example can be seen below:

{
  "Check": {
    "Image": "/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAY"
  }
}

For the header, insert the content type and your subscription key, replacing <API-KEY>, as in the example below:

{
  'Content-Type': 'application/json',
  'Ocp-Apim-Subscription-Key': '<API-KEY>'
}

In the request, the specification that it’s a POST method, the https://api.biopassid.com/quality/check_icao URL, the header, and the body must be passed as in the examples given. See below how this request would be, written in Python, but that can be check in several other programming languages in our documentation:

import http.client
import json

conn = http.client.HTTPSConnection("hml-api.biopassid.com")
payload = json.dumps({
  "Check": {
    "Image": "/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAY"
  }
})
headers = {
  'Content-Type': 'application/json',
  'Ocp-Apim-Subscription-Key': '52ac87259c6e46e78525cb47e469c4ce'
}
conn.request("POST", "/quality/check_icao", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8")

In case you receive the message 200 (OK) in your response, this means the request was completed successfully. The content of the response will be an ICAO object containing details about the result of the examination.

Firstly, it will have a variable FaceImageConformed, that has a numeric value referring to the face position in the picture. The meaning of each number can be seen in the table below:

Code

Description

-1

Error in image processing

0

No problem was found

1

Face not detected

2

No landmark identified

3

Face shifted to the left

4

Face shifted to the right

5

Face shifted up

6

Face shifted down

7

Face is too far

Next, the variable IsAllConformed will contain a Boolean value indicating if the photo completely meets all the requirements imposed by the ICAO standard.

Lastly, there will be a Requirements object, that shows for each requirement if it was met (through the Boolean variable IsConformed) and its assurance level (from 0 to 100, through the variable Confidence). A table showing each requirement and what it means can be seen below:

Requirement

Description

Blurred

The photo must not be blurred

LookingAway

The individual must be staring directly at the camera

InkMarked

The photo must not have ink marks

UnnaturalSkin

The photo must show the individual's natural skin tone

TooDarkLight

The photo must have adequate brightness

WashedOut

The photo must have adequate contrast level

Pixelation

The photo must not be pixelated

HairAcrossEyes

The eyes must not be blocked by the individual’s hair

EyesClosed

Eyes must be opened

VariedBackground

The photo must be taken with a uniform background

Roll_Pitch_Yaw

Head must be faced to the camera and in frontal position

FlashReflectionOnSkin

The picture must not show flash reflections on the skin

RedEyes

The picture must not show red eyes

ShadowsBehindHead

The picture must not have shadows behind the individual

ShadowsAcrossFace

The picture must not have shadows in the face

DarkTintedLenses

The individual cannot be wearing sunglasses

FlashReflectionOnLenses

The picture must not show reflections in the individual’s glasses lens

FramesTooHeavy

Heavy-set glasses must not be worn

FramesCoveringEyes

The frame of the individual's glasses cannot cover his eyes

Hat_Cap

The individual cannot wear a hat or cap in the picture

VeilOverFace

If wearing a veil, it cannot cover the face

MouthOpen

Mouth must be closed

OtherFaces

The individual must be alone in the picture

Lastly, an example showing the system response for the request made previously can be seen below:

{
    "ICAO": {
        "FaceImageConformed": 0,
        "IsAllConformed": false,
        "Requirements": {
            "Blurred": {
                "IsConformed": true,
            },
            "LookingAway": {
                "IsConformed": true,
            },
            "InkMarked": {
                "IsConformed": true,
            },
            "UnnaturalSkin": {
                "IsConformed": true,
            },
            "TooDarkLight": {
                "IsConformed": false,
            },
            "WashedOut": {
                "IsConformed": true,
            },
            "Pixelation": {
                "IsConformed": true,
            },
            "HairAcrossEyes": {
                "IsConformed": true,
            },
            "EyesClosed": {
                "IsConformed": true,
            },
            "VariedBackground": {
                "IsConformed": true,
            },
            "Roll_Pitch_Yaw": {
                "IsConformed": false,
            },
            "FlashReflectionOnSkin": {
                "IsConformed": true,
            },
            "RedEyes": {
                "IsConformed": true,
            },
            "ShadowsBehindHead": {
                "IsConformed": true,
            },
            "ShadowsAcrossFace": {
                "IsConformed": true,
            },
            "DarkTintedLenses": {
                "IsConformed": true,
            },
            "FlashReflectionOnLenses": {
                "IsConformed": true,
            },
            "FramesTooHeavy": {
                "IsConformed": true,
            },
            "FramesCoveringEyes": {
                "IsConformed": false,
            },
            "Hat_Cap": {
                "IsConformed": true,
            },
            "VeilOverFace": {
                "IsConformed": true,
            },
            "MouthOpen": {
                "IsConformed": true,
            },
            "OtherFaces": {
                "IsConformed": true,
            }
        }
    }
}