3DiVi Face SDK
3.24.1
|
Interface object that stores a captured face sample. More...
Classes | |
class | Angles |
Face orientation angles. More... | |
class | Rectangle |
Rectangle in an image. More... | |
Public Types | |
enum | SampleType { SampleType.SAMPLE_TYPE_FRONTAL = 0, SampleType.SAMPLE_TYPE_LEFT_PROFILE = 1, SampleType.SAMPLE_TYPE_RIGHT_PROFILE = 2 } |
Sample types (see also VDT.FaceRecognition.SDK.Capturer.CapturerType). More... | |
enum | ImageFormat { ImageFormat.IMAGE_FORMAT_JPG = 0, ImageFormat.IMAGE_FORMAT_PNG = 1, ImageFormat.IMAGE_FORMAT_TIF = 2, ImageFormat.IMAGE_FORMAT_BMP = 3 } |
Image formats for saving. More... | |
enum | FaceCutType { FaceCutType.FACE_CUT_BASE = 0, FaceCutType.FACE_CUT_FULL_FRONTAL = 1, FaceCutType.FACE_CUT_TOKEN_FRONTAL = 2 } |
Face cropping types. More... | |
Public Member Functions | |
Rectangle | getRectangle () |
Get a face bounding rectangle. Thread-safe. More... | |
List< Point > | getLandmarks () |
Get anthropometric landmarks. Only frontal samples. Thread-safe. More... | |
List< Point > | getIrisLandmarks () |
Get the characteristic points of the eyes. Only frontal samples. Thread-safe. More... | |
Point | getLeftEye () |
Get a point of the left eye. Only frontal samples. Thread-safe. More... | |
Point | getRightEye () |
Get a point of the right eye. Only frontal samples. Thread-safe. More... | |
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 | hasOriginImage () |
Does the sample store the original image (true for samples made with VideoWorker with enabled store_original_frame_in_raw_sample). Thread-safe. More... | |
float | getScore () |
Get the score of the detected face (for samples made with supported single-shot Capturers). Thread-safe. More... | |
float | getFaceVisibilityScore () |
Get the score of face visibility. Thread-safe. More... | |
RawImage | getOriginalImage () |
Get an original image. Throws an exception if a sample doesn’t contain an original image (check with hasOriginalImage (RawSample) first). Thread-safe. More... | |
SampleType | getType () |
Get a sample type. Thread-safe. More... | |
List< Point > | getFaceCutRectangle (FaceCutType cut_type) |
Get a cropping rectangle (for preview) that will be used in RawSample.cutFaceImage. Thread-safe. More... | |
void | cutFaceImage (Stream binary_stream, ImageFormat format, FaceCutType cut_type) |
Crop the face and save in the specified format. Thread-safe. More... | |
RawImage | cutFaceRawImage (RawImage.Format color_model, FaceCutType cut_type) |
Crop face in RawImage format (with raw pixels). Thread-safe. More... | |
void | cutFaceImage (RawImage original_image, Stream binary_stream, ImageFormat format, FaceCutType cut_type) |
Crop the face and save it in original size in the specified format. Thread-safe. More... | |
void | save (Stream binary_stream, ImageFormat format) |
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. After saving, you can load it with FacerecService.loadRawSample. More... | |
void | saveWithoutImage (Stream binary_stream, double space_translation_x=0, double space_translation_y=0, double space_scale=1) |
Save (serialize) all sample information except the image. You have to store the image on your own in order to pass it to the FacerecService.loadRawSampleWithoutImage for deserialization. If you transformed the image in some way, you can set the parameters of coordinate space transformation: (x, y) -> ( (x + space_translation_x) * space_scale, (y + space_translation_y) * space_scale ) that will be applied to the information about face position. Note that you must set parameters of the same transformation only once - either during serialization or during deserialization, otherwise transformation will be applied twice, which is wrong. The format is platform-independent. Thread-safe. After saving, you can load it with FacerecService.loadRawSampleWithoutImage. More... | |
RawSample | downscaleToPreferredSize () |
Clone this RawSample with an internal face image downscaled to preferred size and without an original image. In order to reduce memory consumption (both in RAM and after serialization). At work Capturer and VideoWorker automatically downscale all RawSamples if downscale_rawsamples_to_preferred_size parameter is enabled (enabled by default), but it decreases the performance. So it is recommended to disable downscale_rawsamples_to_preferred_size and use RawSample.downscaleToPreferredSize manually for RawSamples that you need to save or hold for a long time in RAM. More... | |
unsafe Context | ToContext () |
will transform RawSample into a container-Context More... | |
Public Member Functions inherited from VDT.FaceRecognition.SDK.IDisposableObject | |
virtual void | Dispose () |
Release internal object. | |
Additional Inherited Members | |
Properties inherited from VDT.FaceRecognition.SDK.IDisposableObject | |
bool | isDisposed [get] |
True if internal object already disposed. | |
Interface object that stores a captured face sample.
Sample types (see also VDT.FaceRecognition.SDK.Capturer.CapturerType).
Enumerator | |
---|---|
SAMPLE_TYPE_FRONTAL |
The face is frontal-oriented. |
SAMPLE_TYPE_LEFT_PROFILE |
The face is left-profile-oriented. |
SAMPLE_TYPE_RIGHT_PROFILE |
The face is right-profile-oriented. |
|
inline |
Crop the face and save in the specified format. Thread-safe.
[out] | binary_stream | Output stream object for image saving. |
[in] | format | Image encoding format. |
[in] | cut_type | Face cropping types. |
|
inline |
Crop the face and save it in original size in the specified format. Thread-safe.
[in] | original_image | Image that was used to create this sample. |
[out] | binary_stream | Output stream object for image saving. |
[in] | format | Image encoding format. |
[in] | cut_type | Face cropping type. |
|
inline |
|
inline |
Clone this RawSample with an internal face image downscaled to preferred size and without an original image. In order to reduce memory consumption (both in RAM and after serialization).
At work Capturer and VideoWorker automatically downscale all RawSamples if downscale_rawsamples_to_preferred_size parameter is enabled (enabled by default), but it decreases the performance.
So it is recommended to disable downscale_rawsamples_to_preferred_size and use RawSample.downscaleToPreferredSize manually for RawSamples that you need to save or hold for a long time in RAM.
|
inline |
Get a face orientation. Only frontal samples. Thread-safe.
|
inline |
Get a cropping rectangle (for preview) that will be used in RawSample.cutFaceImage. Thread-safe.
[in] | cut_type | Face cropping types. |
|
inline |
Get the score of face visibility. Thread-safe.
|
inline |
Get an ID of the frame, in which this RawSample is detected (for samples made with VideoWorker). Thread-safe.
|
inline |
Get a face ID. Thread-safe.
|
inline |
Get the characteristic points of the eyes. Only frontal samples. Thread-safe.
|
inline |
Get anthropometric landmarks. Only frontal samples. Thread-safe.
|
inline |
Get a point of the left eye. Only frontal samples. Thread-safe.
|
inline |
Get an original image. Throws an exception if a sample doesn’t contain an original image (check with hasOriginalImage (RawSample) first). Thread-safe.
|
inline |
Get a face bounding rectangle. Thread-safe.
|
inline |
Get a point of the right eye. Only frontal samples. Thread-safe.
|
inline |
Get the score of the detected face (for samples made with supported single-shot Capturers). Thread-safe.
|
inline |
Get a sample type. Thread-safe.
|
inline |
Does the sample store the original image (true for samples made with VideoWorker with enabled store_original_frame_in_raw_sample). Thread-safe.
|
inline |
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. After saving, you can load it with FacerecService.loadRawSample.
[out] | binary_stream | Output stream object for saving the raw sample. |
[in] | format | Image encoding format. |
|
inline |
Save (serialize) all sample information except the image. You have to store the image on your own in order to pass it to the FacerecService.loadRawSampleWithoutImage for deserialization. If you transformed the image in some way, you can set the parameters of coordinate space transformation: (x, y) -> ( (x + space_translation_x) * space_scale, (y + space_translation_y) * space_scale ) that will be applied to the information about face position. Note that you must set parameters of the same transformation only once - either during serialization or during deserialization, otherwise transformation will be applied twice, which is wrong. The format is platform-independent. Thread-safe. After saving, you can load it with FacerecService.loadRawSampleWithoutImage.
[out] | binary_stream | Output stream object for saving the raw sample. |
[in] | space_translation_x | Coordinate space transform parameter. |
[in] | space_translation_y | Coordinate space transform parameter. |
[in] | space_scale | Coordinate space transform parameter. |