BWS QualityCheck Web API Documentation

POST https://{bws-instance}.bioid.com/extension/qualitycheck?full=true&issuer=ICAO

With the quality check Web API a single facial media sample can be uploaded to the BWS to perform a rigorous quality check according to ICAO (International Civil Aviation Organization) requirements for machine readable travel documents (MRTDs), which include a standard for the digital image quality of facial images, defining requirements for photographic and digital characteristics (see ISO/IEC 19794-5:2005, ISO/IEC 29794-5:2010 or ICAO Document 9303).

Quality checks for traits other than face are currently not supported with this API.

Remarks

The quality checks performed with this method are descried with the QualityCheck SOAP API.

Request Information

Parameters

full
Optional, defaults to true. A boolean parameter to select full document mode or token data mode. If set to true, the checks are performed according to the ICAO specifications for travel documents and an output sample is created according to these specifications, whereby the content of the sample is not modified. Otherwise, if set to false, the so called token data is extracted from the given sample, which is typically intended to be stored for later use with a biometric recognition system.
issuer
Optional, defaults to ICAO. The quality checks of facial images can be performed according to document-issuer specific settings defined by this parameter. Currently supported issuers are: ICAO (the default settings as specified by ICAO), BioID (similar to ICAO but with a bigger token image) and various ISO 3166-1 alpha-2 country codes specifying the document issuing country.

Request Body Format

The request body contains a single image media sample, encoded into a Data-URL using the data URI scheme as described in RFC 2397 (see also at Wikipedia).

Authentication

This API call requires Basic Authentication, i.e. you have to provide an HTTP authorization header using the authorization method Basic and the base64 encoded string App-ID:App-Secret (therefore the transport is secured using TLS/SSL). To receive the necessary BWS Web API access data (App-ID and App-Secret) you have to register your application on the BWS Management Portal first. This requires a valid BWS subscription.

Response Information

The QualityCheck Web API returns a QualityCheckResult object, which informs about the Success of the check and lists Errors that occurred during the check. Refer to the QualityCheck SOAP API for a list of possible error-codes. Additionally the coordinates of the found EyeCenters are returned. Finally the processed image is returned in the ProcessedSample element if possible, encoded into a Data-URL.

Response Body Format

Exemplary QualityCheck response:
{
	"Success": true,
	"Errors": [
		{
			"Code": "ImageTooSmall",
			"Message": "The part of the image containing the found face is too small.",
			"Details": "The found face (with an eye-distance of 119 pixels) does not have the required eye-distance of at least 240 pixels."
		},
		{
			"Code": "FaceAsymmetry",
			"Message": "It seems that the face of the found person is somehow asymmetric, maybe due to bad illumination and/or due to a wrong pose.",
			"Details": "An asymmetry of 101.99 was calculated, where only a value up to 50.00 is allowed."
		},
		{
			"Code": "ImageTooBlurry",
			"Message": "The image is too blurry, i.e. it is not sharp enough.",
			"Details": "An image blurring of 10.45% was calculated, where up to 9.00% is allowed. Note that compression artifacts might be the reason for this fuzziness as they reduce the objective sharpness more than the subjective sharpness."
		}
	],
	"EyeCenters": 
	{
		"RightEyeX": 828.401, "RightEyeY": 584.267, "LeftEyeX": 947.88, "LeftEyeY": 587.003
	},
	"ProcessedSample": "data:image/bmp;base64,..."
}
Exemplary QualityCheck response:
<QualityCheckResult xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.bioid.com/2011/12/bws">
  <Errors>
    <Error>
      <Code>ImageTooSmall</Code>
      <Message>The part of the image containing the found face is too small.</Message>
      <Details>The found face (with an eye-distance of 119 pixels) does not have the required eye-distance of at least 240 pixels.</Details>
    </Error>
    <Error>
      <Code>FaceAsymmetry</Code>
      <Message>It seems that the face of the found person is somehow asymmetric, maybe due to bad illumination and/or due to a wrong pose.</Message>
      <Details>An asymmetry of 101.99 was calculated, where only a value up to 50.00 is allowed.</Details>
    </Error>
    <Error>
      <Code>ImageTooBlurry</Code>
      <Message>The image is too blurry, i.e. it is not sharp enough.</Message>
      <Details>An image blurring of 10.45% was calculated, where up to 9.00% is allowed. Note that compression artifacts might be the reason for this fuzziness as they reduce the objective sharpness more than the subjective sharpness.</Details>
    </Error>
  </Errors>
  <EyeCenters>
    <LeftEyeX>947.88</LeftEyeX>
    <LeftEyeY>587.003</LeftEyeY>
    <RightEyeX>828.401</RightEyeX>
    <RightEyeY>584.267</RightEyeY>
  </EyeCenters>
  <ProcessedSample>data:image/bmp;base64,...</ProcessedSample>
  <Success>true</Success>
</QualityCheckResult>

Response HTTP Status Codes

The call returns one of the standard HTTP status codes. With the success code (200) you receive the QualityCheckResult object in the body text. With erroneous codes you typically receive a Message field within the body text describing the error. The most commonly return codes are:

200 OK
The response body contains the QualityCheckResult object.
400 Bad Request
No or an invalid sample data has been uploaded.
401 Unauthorized
No or an invalid authentication header has been specified. This call requires Basic Authentication.
403 Forbidden
Access has been denied (typically due to a wrong or invalid app-id).
500 Internal Server Error
A server side exception occurred.