The Compare Photos function is used to complete a photo comparison and verification process.
This API compares a face in the source input image with the largest face detected in the target input image. If the source image contains multiple faces, the service detects the largest face and compares it with the largest face detected in the target image. You must pass the source and target images as base64-encoded string.
The targetImage
is further analyzed for liveness as well and will return a liveness score, error and assessment accordingly.
To Reauthenticateā¢ someone with just a selfie, use the documentFaceMatch
functionality. This will compare the targetImage
to the image of the face that was extrapolated from the Photo ID or Passport used to initially authenticate this person.
The documentFaceMatch
and targetImage
parameters are required and documentFaceMatch
is a boolean.
If the sourceImage
is provided, it overrides the documentFaceMatch
flag and compares the targetImage
with the sourceImage
.
Important Notes:-
- In this example, we wrote both the first and second photo to be obtained via the camera, which if copied directly will not follow the guidelines mentioned above. Please make sure that the first photo included will be from a source other than the camera.
- This call does not return an indicator as to whether or not they actually passed the photo verification, this endpoint returns a success if the two images sent were successfully uploaded and saved to the database; the image comparison runs asynchronously.
- The maximum allowed size of the image uploaded (per image) is capped at 2MB. Please do not send in photos larger than 2MB, as an exception will be thrown. We recommend using the standard compression techniques to compress the photo before sending it to us.
The comparison results can be found in the Test Results Object under the photoProof
JSON key.