amazonka-rekognition-1.6.1: Amazon Rekognition SDK.

Copyright(c) 2013-2018 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay <brendan.g.hay+amazonka@gmail.com>
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellNone
LanguageHaskell2010

Network.AWS.Rekognition.CompareFaces

Contents

Description

Compares a face in the source input image with each of the 100 largest faces detected in the target input image.

You pass the input and target images either as base64-encoded image bytes or as a references to images in an Amazon S3 bucket. If you use the Amazon CLI to call Amazon Rekognition operations, passing image bytes is not supported. The image must be either a PNG or JPEG formatted file.

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.

If no faces are detected in the source or target images, CompareFaces returns an InvalidParameterException error.

For an example, see 'faces-compare-images' .

This operation requires permissions to perform the rekognition:CompareFaces action.

Synopsis

Creating a Request

compareFaces Source #

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 the FaceMatches array.
  • cfSourceImage - The input image as base64-encoded bytes or an S3 object. If you use the AWS CLI to call Amazon Rekognition operations, passing base64-encoded image bytes is not supported.
  • cfTargetImage - The target image as base64-encoded bytes or an S3 object. If you use the AWS CLI to call Amazon Rekognition operations, passing base64-encoded image bytes is not supported.

data CompareFaces Source #

See: compareFaces smart constructor.

Instances
Eq CompareFaces Source # 
Instance details

Defined in Network.AWS.Rekognition.CompareFaces

Data CompareFaces Source # 
Instance details

Defined in Network.AWS.Rekognition.CompareFaces

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> CompareFaces -> c CompareFaces #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c CompareFaces #

toConstr :: CompareFaces -> Constr #

dataTypeOf :: CompareFaces -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c CompareFaces) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c CompareFaces) #

gmapT :: (forall b. Data b => b -> b) -> CompareFaces -> CompareFaces #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> CompareFaces -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> CompareFaces -> r #

gmapQ :: (forall d. Data d => d -> u) -> CompareFaces -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> CompareFaces -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> CompareFaces -> m CompareFaces #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> CompareFaces -> m CompareFaces #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> CompareFaces -> m CompareFaces #

Read CompareFaces Source # 
Instance details

Defined in Network.AWS.Rekognition.CompareFaces

Show CompareFaces Source # 
Instance details

Defined in Network.AWS.Rekognition.CompareFaces

Generic CompareFaces Source # 
Instance details

Defined in Network.AWS.Rekognition.CompareFaces

Associated Types

type Rep CompareFaces :: Type -> Type #

Hashable CompareFaces Source # 
Instance details

Defined in Network.AWS.Rekognition.CompareFaces

ToJSON CompareFaces Source # 
Instance details

Defined in Network.AWS.Rekognition.CompareFaces

AWSRequest CompareFaces Source # 
Instance details

Defined in Network.AWS.Rekognition.CompareFaces

Associated Types

type Rs CompareFaces :: Type #

ToHeaders CompareFaces Source # 
Instance details

Defined in Network.AWS.Rekognition.CompareFaces

ToPath CompareFaces Source # 
Instance details

Defined in Network.AWS.Rekognition.CompareFaces

ToQuery CompareFaces Source # 
Instance details

Defined in Network.AWS.Rekognition.CompareFaces

NFData CompareFaces Source # 
Instance details

Defined in Network.AWS.Rekognition.CompareFaces

Methods

rnf :: CompareFaces -> () #

type Rep CompareFaces Source # 
Instance details

Defined in Network.AWS.Rekognition.CompareFaces

type Rep CompareFaces = D1 (MetaData "CompareFaces" "Network.AWS.Rekognition.CompareFaces" "amazonka-rekognition-1.6.1-ELwOF0LSGWFp8S3Ef6QMe" False) (C1 (MetaCons "CompareFaces'" PrefixI True) (S1 (MetaSel (Just "_cfSimilarityThreshold") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Double)) :*: (S1 (MetaSel (Just "_cfSourceImage") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Image) :*: S1 (MetaSel (Just "_cfTargetImage") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Image))))
type Rs CompareFaces Source # 
Instance details

Defined in Network.AWS.Rekognition.CompareFaces

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 input image as base64-encoded bytes or an S3 object. If you use the AWS CLI to call Amazon Rekognition operations, passing base64-encoded image bytes is not supported.

cfTargetImage :: Lens' CompareFaces Image Source #

The target image as base64-encoded bytes or an S3 object. If you use the AWS CLI to call Amazon Rekognition operations, passing base64-encoded image bytes is not supported.

Destructuring the Response

compareFacesResponse Source #

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. 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 - 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 in FaceMatches and UnmatchedFaces 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 in SourceImageFace 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.

Instances
Eq CompareFacesResponse Source # 
Instance details

Defined in Network.AWS.Rekognition.CompareFaces

Data CompareFacesResponse Source # 
Instance details

Defined in Network.AWS.Rekognition.CompareFaces

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> CompareFacesResponse -> c CompareFacesResponse #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c CompareFacesResponse #

toConstr :: CompareFacesResponse -> Constr #

dataTypeOf :: CompareFacesResponse -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c CompareFacesResponse) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c CompareFacesResponse) #

gmapT :: (forall b. Data b => b -> b) -> CompareFacesResponse -> CompareFacesResponse #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> CompareFacesResponse -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> CompareFacesResponse -> r #

gmapQ :: (forall d. Data d => d -> u) -> CompareFacesResponse -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> CompareFacesResponse -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> CompareFacesResponse -> m CompareFacesResponse #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> CompareFacesResponse -> m CompareFacesResponse #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> CompareFacesResponse -> m CompareFacesResponse #

Read CompareFacesResponse Source # 
Instance details

Defined in Network.AWS.Rekognition.CompareFaces

Show CompareFacesResponse Source # 
Instance details

Defined in Network.AWS.Rekognition.CompareFaces

Generic CompareFacesResponse Source # 
Instance details

Defined in Network.AWS.Rekognition.CompareFaces

Associated Types

type Rep CompareFacesResponse :: Type -> Type #

NFData CompareFacesResponse Source # 
Instance details

Defined in Network.AWS.Rekognition.CompareFaces

Methods

rnf :: CompareFacesResponse -> () #

type Rep CompareFacesResponse Source # 
Instance details

Defined in Network.AWS.Rekognition.CompareFaces

type Rep CompareFacesResponse = D1 (MetaData "CompareFacesResponse" "Network.AWS.Rekognition.CompareFaces" "amazonka-rekognition-1.6.1-ELwOF0LSGWFp8S3Ef6QMe" False) (C1 (MetaCons "CompareFacesResponse'" PrefixI True) ((S1 (MetaSel (Just "_cfrsFaceMatches") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe [CompareFacesMatch])) :*: (S1 (MetaSel (Just "_cfrsUnmatchedFaces") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe [ComparedFace])) :*: S1 (MetaSel (Just "_cfrsTargetImageOrientationCorrection") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe OrientationCorrection)))) :*: (S1 (MetaSel (Just "_cfrsSourceImageOrientationCorrection") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe OrientationCorrection)) :*: (S1 (MetaSel (Just "_cfrsSourceImageFace") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe ComparedSourceImageFace)) :*: S1 (MetaSel (Just "_cfrsResponseStatus") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Int)))))

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.