Copyright | (c) 2013-2017 Brendan Hay |
---|---|
License | Mozilla Public License, v. 2.0. |
Maintainer | Brendan Hay <brendan.g.hay+amazonka@gmail.com> |
Stability | auto-generated |
Portability | non-portable (GHC extensions) |
Safe Haskell | None |
Language | Haskell2010 |
Compares a face in the source input image with each face detected in the target input image.
In response, the operation returns an array of face matches ordered by similarity score in descending order. For each face match, the response provides a bounding box of the face, facial landmarks, pose details (pitch, role, and yaw), quality (brightness and sharpness), and confidence value (indicating the level of confidence that the bounding box contains a face). The response also provides a similarity score, which indicates how closely the faces match.
CompareFaces
also returns an array of faces that don't match the source image. For each face, it returns a bounding box, confidence value, landmarks, pose details, and quality. The response also returns information about the face in the source image, including the bounding box of the face and confidence value.
If the image doesn't contain Exif metadata, CompareFaces
returns orientation information for the source and target images. Use these values to display the images with the correct image orientation.
For an example, see 'get-started-exercise-compare-faces' .
This operation requires permissions to perform the rekognition:CompareFaces
action.
- compareFaces :: Image -> Image -> CompareFaces
- data CompareFaces
- cfSimilarityThreshold :: Lens' CompareFaces (Maybe Double)
- cfSourceImage :: Lens' CompareFaces Image
- cfTargetImage :: Lens' CompareFaces Image
- compareFacesResponse :: Int -> CompareFacesResponse
- data CompareFacesResponse
- cfrsFaceMatches :: Lens' CompareFacesResponse [CompareFacesMatch]
- cfrsUnmatchedFaces :: Lens' CompareFacesResponse [ComparedFace]
- cfrsTargetImageOrientationCorrection :: Lens' CompareFacesResponse (Maybe OrientationCorrection)
- cfrsSourceImageOrientationCorrection :: Lens' CompareFacesResponse (Maybe OrientationCorrection)
- cfrsSourceImageFace :: Lens' CompareFacesResponse (Maybe ComparedSourceImageFace)
- cfrsResponseStatus :: Lens' CompareFacesResponse Int
Creating a Request
Creates a value of CompareFaces
with the minimum fields required to make a request.
Use one of the following lenses to modify other fields as desired:
cfSimilarityThreshold
- The minimum level of confidence in the face matches that a match must meet to be included in theFaceMatches
array.cfSourceImage
- The source image, either as bytes or as an S3 object.cfTargetImage
- The target image, either as bytes or as an S3 object.
data CompareFaces Source #
See: compareFaces
smart constructor.
Request Lenses
cfSimilarityThreshold :: Lens' CompareFaces (Maybe Double) Source #
The minimum level of confidence in the face matches that a match must meet to be included in the FaceMatches
array.
cfSourceImage :: Lens' CompareFaces Image Source #
The source image, either as bytes or as an S3 object.
cfTargetImage :: Lens' CompareFaces Image Source #
The target image, either as bytes or as an S3 object.
Destructuring the Response
Creates a value of CompareFacesResponse
with the minimum fields required to make a request.
Use one of the following lenses to modify other fields as desired:
cfrsFaceMatches
- An array of faces in the target image that match the source image face. EachCompareFacesMatch
object provides the bounding box, the confidence level that the bounding box contains a face, and the similarity score for the face in the bounding box and the face in the source image.cfrsUnmatchedFaces
- An array of faces in the target image that did not match the source image face.cfrsTargetImageOrientationCorrection
- The orientation of the target image (in counterclockwise direction). If your application displays the target image, you can use this value to correct the orientation of the image. The bounding box coordinates returned inFaceMatches
andUnmatchedFaces
represent face locations before the image orientation is corrected.cfrsSourceImageOrientationCorrection
- The orientation of the source image (counterclockwise direction). If your application displays the source image, you can use this value to correct image orientation. The bounding box coordinates returned inSourceImageFace
represent the location of the face before the image orientation is corrected.cfrsSourceImageFace
- The face in the source image that was used for comparison.cfrsResponseStatus
- -- | The response status code.
data CompareFacesResponse Source #
See: compareFacesResponse
smart constructor.
Response Lenses
cfrsFaceMatches :: Lens' CompareFacesResponse [CompareFacesMatch] Source #
An array of faces in the target image that match the source image face. Each CompareFacesMatch
object provides the bounding box, the confidence level that the bounding box contains a face, and the similarity score for the face in the bounding box and the face in the source image.
cfrsUnmatchedFaces :: Lens' CompareFacesResponse [ComparedFace] Source #
An array of faces in the target image that did not match the source image face.
cfrsTargetImageOrientationCorrection :: Lens' CompareFacesResponse (Maybe OrientationCorrection) Source #
The orientation of the target image (in counterclockwise direction). If your application displays the target image, you can use this value to correct the orientation of the image. The bounding box coordinates returned in FaceMatches
and UnmatchedFaces
represent face locations before the image orientation is corrected.
cfrsSourceImageOrientationCorrection :: Lens' CompareFacesResponse (Maybe OrientationCorrection) Source #
The orientation of the source image (counterclockwise direction). If your application displays the source image, you can use this value to correct image orientation. The bounding box coordinates returned in SourceImageFace
represent the location of the face before the image orientation is corrected.
cfrsSourceImageFace :: Lens' CompareFacesResponse (Maybe ComparedSourceImageFace) Source #
The face in the source image that was used for comparison.
cfrsResponseStatus :: Lens' CompareFacesResponse Int Source #
- - | The response status code.