Enrollment 28.2.0
Loading...
Searching...
No Matches

Face capture can contains one or group of people, faces or full body. More...

#include <FaceCapture.h>

Collaboration diagram for FaceCapture:

Public Member Functions

void WriteTo (Writer &writer) const final
 Write itself into writer.
std::vector< std::shared_ptr< Face > > DetectWith (FaceCaptureSegmentation &detector)
 Detects faces in the current face capture.
std::shared_ptr< Image > CropFace (const Rectangle &rectangle, const RGBA &backgroundColor) const
 It crops image with given rectangle and background color.
bool IsWholeCroppedRectangleInside (const Rectangle &rectangle) const
 Calculates intersection of image and cropping rectangle.
std::shared_ptr< Image > Draw (const std::vector< std::shared_ptr< Face > > &faces, const ImageShapeAttributes &attr) const
 It draws rounding boxes into FaceCapture.
std::shared_ptr< FaceCapture > ResizeToMaxDimension (ImageDimension maxDimension)
 Returns new FaceCapture with resized image to given max dimension.
ImageDimension MaxImageDimension () const
 Returns max dimension of image in FaceCapture.
std::shared_ptr< Image > Draw (const Rectangle &boundingBox, const ImageShapeAttributes &attr) const
 It draws bounding box into FaceCapture.

Static Public Member Functions

static std::shared_ptr< FaceCapture > Create (std::shared_ptr< Image > img, const FaceAttributes &fa=FaceAttributes())
 Constructor of FaceCapture.
static std::shared_ptr< FaceCapture > FromIsoImage (const std::vector< uint8_t > &isoImage)
 Function creates Face object from ISO image based on ISO/IEC 19794-5 (Face image data).

Public Attributes

const std::shared_ptr< Image > image
 Provides FaceCapture Image.
const FaceAttributes faceAttributes
 Provides FaceAttributes.

Detailed Description

Face capture can contains one or group of people, faces or full body.

Member Function Documentation

◆ Create()

std::shared_ptr< FaceCapture > Create ( std::shared_ptr< Image > img,
const FaceAttributes & fa = FaceAttributes() )
inlinestaticnodiscard

Constructor of FaceCapture.

Parameters
imgface capture image, will be moved into this class
faFaceAttributes
Returns
created FaceCapture object
Exceptions
NullArgumentExceptionwhen image is null

Referenced by FromIsoImage(), CroppedFace::GetFaceCapture(), and ResizeToMaxDimension().

Here is the caller graph for this function:

◆ CropFace()

std::shared_ptr< Image > CropFace ( const Rectangle & rectangle,
const RGBA & backgroundColor ) const
inlinenodiscard

It crops image with given rectangle and background color.

Can be used for manual segmentation.

Parameters
rectangleRectangle to be cropped
backgroundColorbackground color for area cropped outside image
Returns
Image cropped image

References image.

◆ DetectWith()

std::vector< std::shared_ptr< Face > > DetectWith ( FaceCaptureSegmentation & detector)
inlinenodiscard

Detects faces in the current face capture.

This method uses the provided face detection algorithm to find faces within the current face capture. The detector must be an implementation of FaceCaptureSegmentation, such as FaceDetector.

Parameters
detectorA reference to a FaceCaptureSegmentation implementation used for face detection.
Returns
detected Face objects.
Exceptions
EnrollmentExceptionIf the detector encounters an error during face detection.

◆ Draw() [1/2]

std::shared_ptr< Image > Draw ( const Rectangle & boundingBox,
const ImageShapeAttributes & attr ) const
inlinenodiscard

It draws bounding box into FaceCapture.

Parameters
boundingBoxbounding box to draw
attrShapeAttributes of rounding boxes
Returns
Image with drawn rounding boxes

References GlobalLogger::Get(), image, and FormattingLogger::LogInfo().

Here is the call graph for this function:

◆ Draw() [2/2]

std::shared_ptr< Image > Draw ( const std::vector< std::shared_ptr< Face > > & faces,
const ImageShapeAttributes & attr ) const
inlinenodiscard

It draws rounding boxes into FaceCapture.

Parameters
facesdetected faces
attrShapeAttributes of rounding boxes
Returns
Image with drawn bounding boxes

References GlobalLogger::Get(), image, and FormattingLogger::LogInfo().

Here is the call graph for this function:

◆ FromIsoImage()

std::shared_ptr< FaceCapture > FromIsoImage ( const std::vector< uint8_t > & isoImage)
inlinestaticnodiscard

Function creates Face object from ISO image based on ISO/IEC 19794-5 (Face image data).

[6]

Parameters
isoImageISO image from ISO/IEC 19794-5 (Face image data)
Returns
decoded FaceCapture
Exceptions
ImageExceptionwhen type is not supported or image data are corrupted
EnrollmentInvalidArgumentExceptionwhen not possible to decode ISO image

References Create(), Image::Decode(), IsoToFaceCaptureDeviceTechnology(), FaceAttributes::SetCaptureDeviceTechnology(), FaceAttributes::SetCaptureDeviceTypeID(), and FaceAttributes::SetCaptureDeviceVendorID().

Here is the call graph for this function:

◆ IsWholeCroppedRectangleInside()

bool IsWholeCroppedRectangleInside ( const Rectangle & rectangle) const
inlinenodiscard

Calculates intersection of image and cropping rectangle.

Parameters
rectangleRectangle to crop
Returns
true when whole rectangle is inside image
false when whole rectangle is not inside image

References image, Image::INSIDE, and Image::SAME.

◆ MaxImageDimension()

ImageDimension MaxImageDimension ( ) const
inlinenodiscard

Returns max dimension of image in FaceCapture.

Returns
max dimension of image in FaceCapture.

References image.

◆ ResizeToMaxDimension()

std::shared_ptr< FaceCapture > ResizeToMaxDimension ( ImageDimension maxDimension)
inlinenodiscard

Returns new FaceCapture with resized image to given max dimension.

When any image dimension does not exceed given maximum dimension then original FaceCapture is returned. Otherwise new FaceCapture with resized image is returned.

Parameters
maxDimensionmax dimension of new Image in FaceCapture
Returns
new FaceCapture with resized image

References Create(), and image.

Here is the call graph for this function:

◆ WriteTo()

void WriteTo ( Writer & writer) const
inlinefinalvirtual

Write itself into writer.

Parameters
writerWriter to use to serialize this Serializable

Implements Serializable.

References faceAttributes, and image.


The documentation for this class was generated from the following file: