3DiVi Face SDK  3.24.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Groups
RawSample Class Reference

Interface object that stores a captured face sample. More...

#import <RawSample.h>

Instance Methods

(nonnull Rectangle *) - getRectangle
 Get a face bounding rectangle. Thread-safe. More...
 
(nonnull NSMutableArray *) - getLandmarks
 Get anthropometric landmarks. Only frontal samples. Thread-safe. More...
 
(nonnull Point2 *) - getLeftEye
 Get a point of the left eye. Only frontal samples. Thread-safe. More...
 
(nonnull Point2 *) - getRightEye
 Get a point of the right eye. Only frontal samples. Thread-safe. More...
 
(nonnull Angles *) - getAngles
 Get a face orientation. Only frontal samples. Thread-safe. More...
 
(int) - getID
 Get a face ID. Thread-safe. More...
 
(int) - getFrameID
 Get an ID of the frame, in which this RawSample is detected (for samples made with VideoWorker). Thread-safe. More...
 
(bool) - hasOriginalImage
 Does the sample store the original image (true for samples made with VideoWorker with enabled store_original_frame_in_raw_sample). Thread-safe. More...
 
(SampleType) - getType
 Get a sample type. Thread-safe. More...
 
(nonnull RawImage *) - cutFaceRawImage
 Crop face in RawImage format (with raw pixels). Thread-safe. More...
 
(void) - save:
 Save (serialize) the sample. Original image will not be saved (i.e. only the part of an image containing the face is saved). The format is platform-independent. Thread-safe. More...
 
(nonnull NSMutableArray *) - getFaceCutRectangle:
 Get a cropping rectangle (for preview) that will be used in cutFaceImage. Thread-safe. More...
 

Detailed Description

Interface object that stores a captured face sample.

Method Documentation

- (nonnull RawImage *) cutFaceRawImage

Crop face in RawImage format (with raw pixels). Thread-safe.

Parameters
[in]color_modelImage color model.
[in]cut_typeFace cropping types.
Returns
RawImage with cropped face
- (nonnull Angles *) getAngles

Get a face orientation. Only frontal samples. Thread-safe.

Returns
Face orientation angles in degrees.
- (nonnull NSMutableArray *) getFaceCutRectangle: (FaceCutType)  cut_type

Get a cropping rectangle (for preview) that will be used in cutFaceImage. Thread-safe.

Returns
4 points that are corners of a rectangle in the counterclockwise order starting from the upper left corner.
Parameters
[in]cut_typeFace cropping types.
- (int) getFrameID

Get an ID of the frame, in which this RawSample is detected (for samples made with VideoWorker). Thread-safe.

Returns
Zero if this RawSample was made not with VideoWorker,
otherwise it's a nonnegative integer - id (that was returned by the VideoWorker::addVideoFrame) of the frame, in which this RawSample is detected.
- (int) getID

Get a face ID. Thread-safe.

Returns
  • A non-negative track id, if this sample was captured by a tracker, or
  • Any meaningless negative value, otherwise.
- (nonnull NSMutableArray *) getLandmarks

Get anthropometric landmarks. Only frontal samples. Thread-safe.

Returns
The vector of anthropometric points in the original image.
- (nonnull Point2 *) getLeftEye

Get a point of the left eye. Only frontal samples. Thread-safe.

Returns
Point of the left eye.
- (nonnull Rectangle *) getRectangle

Get a face bounding rectangle. Thread-safe.

Returns
Rectangle bounding face on the original image.
- (nonnull Point2 *) getRightEye

Get a point of the right eye. Only frontal samples. Thread-safe.

Returns
Point of the right eye.
- (SampleType) getType

Get a sample type. Thread-safe.

Returns
Type of the sample.
- (bool) hasOriginalImage

Does the sample store the original image (true for samples made with VideoWorker with enabled store_original_frame_in_raw_sample). Thread-safe.

Returns
true, if it has original image, otherwise false.
- (void) save: (const char *_Nullable)  file_path

Save (serialize) the sample. Original image will not be saved (i.e. only the part of an image containing the face is saved). The format is platform-independent. Thread-safe.

Parameters
[out]file_path