|
visageSDK
|
Faces and facial features detector implementation. More...
Public Member Functions | |
| VisageFeaturesDetector (string detectorConfigFile) | |
| Constructor that receives detector configuration file and initializes the features detector. More... | |
| ~VisageFeaturesDetector () | |
| Destructor. More... | |
| int | DetectFacialFeatures (VSImage frame, FaceData[] output, float minFaceScale=0.1f, float maxFaceScale=1.0f, bool outputOnly2DFeatures=false) |
| int | DetectFaces (VSImage frame, VSRect[] faces, float minFaceScale=0.1f, float maxFaceScale=1.0f, bool useRefinementStep=true) |
Faces and facial features detector implementation.
This class detects one or more faces and their facial features in an image. The input is an image bitmap or an image file in one of the supported file formats: JPEG, PNG, BMP or PPM. The results are, for each detected face, the 3D head pose, gaze direction, eye closure, the coordinates of facial feature points, e.g. chin tip, nose tip, lip corners etc. and 3D face model fitted to the face.
The results are returned in one or more FaceData objects, one for each detected face. Please refer to the FaceData documentation for detailed description of returned data.
To use the detector, pass the detector configuration file to the Visage Features Detector constructor. The name of the configuration file should be relative to the current working directory. Then, call the function DetectFacialFeatures() to perform facial features detection on the image.
Example:
Please note that vft folder and the configuration file must be distributed with an application using VisageFeaturesDetector.
Definition at line 29 of file VisageFeaturesDetector.cs.
| VisageCSWrapper.VisageFeaturesDetector.VisageFeaturesDetector | ( | string | detectorConfigFile | ) |
Constructor that receives detector configuration file and initializes the features detector.
Several data files are needed for facial features detection. In the current distribution these files are contained within the Samples/data folder.
To successfully initialize VisageFeaturesDetector, provide path to the folder with the following folder structure and data files:
| detectorConfigFile | The name of the detector configuration file (.cfg) relative to the current working directory, e.g. "Samples/data/Face Detector.cfg", considering visageSDK as a working directory. |
| VisageCSWrapper.VisageFeaturesDetector.~VisageFeaturesDetector | ( | ) |
Destructor.
| int VisageCSWrapper.VisageFeaturesDetector.DetectFaces | ( | VSImage | frame, |
| VSRect[] | faces, | ||
| float | minFaceScale = 0.1f, |
||
| float | maxFaceScale = 1.0f, |
||
| bool | useRefinementStep = true |
||
| ) |
Performs face detection in a still image.
The algorithm detects one or more faces. For each detected face a square facial bounding box is returned.
The results are returned in form of VsRect objects. An array of VsRect objects passed to this method as output parameter should be allocated to maxFaces size. For example:
After this call, n contains the number of detected faces. The first n members of the faces array are filled with resulting bounding boxes for each detected face.
VsImage is the image storage class similar to IplImage from OpenCV, it has the same structure and members so it can be used like IplImage. Please refer to OpenCV documentation for details of accessing IplImage data members; the basic members are the size of the image (frame->width, frame->height) and the pointer to the actual pixel data of the image (frame->imageData).
Following image formats are supported:
Note that the input image is internally converted to grayscale.
| frame | The input image. |
| faces | Pointer to an array of VSRect objects in which the results will be returned. |
| minFaceScale | Scale of smallest face to be searched for, defined as decimal fraction [0.0 - 1.0] of input image size (min(width, height)). |
| maxFaceScale | Scale of largest face to be searched for, defined as decimal fraction [0.0 - 1.0] of input image size (min(width, height)). |
| useRefinementStep | If set to true, additional refinement algorithm will be used resulting with more precise facial bounding boxes and lower FPR, but higher detection time. |
| int VisageCSWrapper.VisageFeaturesDetector.DetectFacialFeatures | ( | VSImage | frame, |
| FaceData[] | output, | ||
| float | minFaceScale = 0.1f, |
||
| float | maxFaceScale = 1.0f, |
||
| bool | outputOnly2DFeatures = false |
||
| ) |
Performs faces and facial features detection in a still image.
The algorithm detects one or more faces and their features. The results are, for each detected face, the 3D head pose, gaze direction, eye closure, the coordinates of facial feature points (e.g. chin tip, nose tip, lip corners etc.) and 3D face model fitted to the face.
The results are returned in form of FaceData objects. An array of FaceData objects passed to this method as output parameter should be allocated to maxFaces size. For example:
After this call, n contains the number of faces actually detected. The first n members of the data array are filled with resulting data for each detected face. Please refer to the FaceData documentation for detailed description of returned parameters.
Following image formats are supported:
Note that the input image is internally converted to grayscale.
| frame | The input image. |
| output | Pointer to an array of FaceData objects in which the results will be returned. |
| minFaceScale | Scale of smallest face to be searched for, defined as decimal fraction [0.0 - 1.0] of input image size (min(width, height)). |
| maxFaceScale | Scale of smallest face to be searched for, defined as decimal fraction [0.0 - 1.0] of input image size (min(width, height)). |
| outputOnly2DFeatures | If set, detection time will be reduced and only featurePoints2D will be returned. |
1.8.10