Enrollment 28.2.0
Loading...
Searching...
No Matches
CroppedFace Class Reference

Represents a face cropped from the original face capture. More...

#include <Face.h>

Collaboration diagram for CroppedFace:

Public Member Functions

std::shared_ptr< FaceCapture > GetFaceCapture () const
 Retrieves the face capture from the cropped region.
Rectangle GetCropRectangle () const
 Gets the crop region of the face within the image.
bool IsCropRegionInsideImage () const
 Checks if the crop region is entirely inside the image.
std::shared_ptr< Image > FaceAreaMask () const
 Creates an image representing the mask of the detected face in the original FaceCapture, considering the applied FaceCropConfiguration.
std::shared_ptr< Image > FaceAreaSegment (const RGB &color) const
 Creates an image of the detected face in the original FaceCapture, with the surrounding area replaced by a given color, considering the applied FaceCropConfiguration.
std::shared_ptr< Image > FaceAreaSegment () const
 Creates an image of the detected face in the original FaceCapture, with a transparent surrounding area, considering the applied FaceCropConfiguration.

Friends

class Face

Detailed Description

Represents a face cropped from the original face capture.

Member Function Documentation

◆ FaceAreaMask()

std::shared_ptr< Image > FaceAreaMask ( ) const
inlinenodiscard

Creates an image representing the mask of the detected face in the original FaceCapture, considering the applied FaceCropConfiguration.

Each pixel that belongs to face has white color, the surrounding has black color.

Returns
Image image with mask
Exceptions
EnrollmentExceptionwhen it is not possible to get mask
Required Solvers

Total size of solvers is 52 MB.

References face-segmentation-mask.solver

References Image::DecodeRawImage(), FULL_NOT_ALIGNED, and RawImage::GRAYSCALE.

Here is the call graph for this function:

◆ FaceAreaSegment() [1/2]

std::shared_ptr< Image > FaceAreaSegment ( ) const
inlinenodiscard

Creates an image of the detected face in the original FaceCapture, with a transparent surrounding area, considering the applied FaceCropConfiguration.

Returns
Image image with face and transparent surrounding
Exceptions
EnrollmentExceptionwhen it is not possible to get segmented face area
Required Solvers

Total size of solvers is 52 MB.

References face-segmentation-mask.solver

References RawImage::BGRA, Image::DecodeRawImage(), and FULL_NOT_ALIGNED.

Here is the call graph for this function:

◆ FaceAreaSegment() [2/2]

std::shared_ptr< Image > FaceAreaSegment ( const RGB & color) const
inlinenodiscard

Creates an image of the detected face in the original FaceCapture, with the surrounding area replaced by a given color, considering the applied FaceCropConfiguration.

Parameters
colorsurrounding RGB
Returns
Image image with face and colored surrounding
Exceptions
EnrollmentExceptionwhen it is not possible to get segmented face area
Required Solvers

Total size of solvers is 52 MB.

References face-segmentation-mask.solver

References RawImage::BGR, RGB::blue, Image::DecodeRawImage(), FULL_NOT_ALIGNED, RGB::green, and RGB::red.

Here is the call graph for this function:

◆ GetCropRectangle()

Rectangle GetCropRectangle ( ) const
inlinenodiscard

Gets the crop region of the face within the image.

Returns
A Rectangle defining the cropped region.

Referenced by GetFaceCapture(), and IsCropRegionInsideImage().

Here is the caller graph for this function:

◆ GetFaceCapture()

std::shared_ptr< FaceCapture > GetFaceCapture ( ) const
inlinenodiscard

Retrieves the face capture from the cropped region.

Returns
FaceCapture instance of cropped image.

References BASIC, RawImage::BGR, FaceCapture::Create(), Image::DecodeRawImage(), FULL, FULL_FRONTAL, FULL_NOT_ALIGNED, GetCropRectangle(), TOKEN, and TOKEN_FRONTAL.

Here is the call graph for this function:

◆ IsCropRegionInsideImage()

bool IsCropRegionInsideImage ( ) const
inlinenodiscard

Checks if the crop region is entirely inside the image.

Returns
True if the crop region is within the image bounds, false otherwise.

References GetCropRectangle().

Here is the call graph for this function:

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