|
visageSDK
|
Objective-C wrapper of the native VisageSDK::VisageFaceAnalyser class. More...
#import <objc_VisageFaceAnalyser.h>
Inherits NSObject.
Instance Methods | |
| (VisageFaceAnalyser *) | - initWithDataPath: |
| Constructor. More... | |
| (VFAReturnCode) | - analyseImage:withFaceData:withOptions:withAnalysisData: |
| Performs the specified face analysis tasks on a given image and outputs results to an AnalysisData object instance. More... | |
| (VFAReturnCode) | - analyseStream:withFaceData:withOptions:withAnalysisData:withFaceIndex: |
| Performs the specified face analysis tasks on a given frame and outputs results to an AnalysisData object instance. More... | |
| (void) | - resetStreamAnalysis: |
| Resets age, gender and emotion data for the specified face index. More... | |
| (void) | - resetStreamAnalysis |
| Resets age, gender and emotion data for all faces. More... | |
Objective-C wrapper of the native VisageSDK::VisageFaceAnalyser class.
Definition at line 67 of file objc_VisageFaceAnalyser.h.
| - (VFAReturnCode) analyseImage: | (VisageImage *) | image | |
| withFaceData: | (FaceData *) | faceData | |
| withOptions: | (VFAFlags) | options | |
| withAnalysisData: | (AnalysisData *) | results | |
Performs the specified face analysis tasks on a given image and outputs results to an AnalysisData object instance.
This function is primarily intended for performing face analysis on a single image, or consecutive unrelated images. As such, it outputs raw, unfiltered estimation data without smoothing or averaging.
Prior to using this function it is necessary to process the facial image using VisageTracker or VisageFeaturesDetector and pass the frame and obtained data to this function. When using data from VisageTracker, only data obtained when tracking status was TRACK_STAT_OK should be passed.
Usage example:
| image | The input grayscale, RGB or RGBA image. |
| faceData | FaceData obtained by a previous successful tracking (TRACK_STAT_OK) or detection operation with VisageTracker or VisageFeaturesDetector. |
| options | Bitwise combination of VFAFlags which determines the analysis operations to be performed |
| results | AnalysisData interface containing success flags for individual operations and their assorted results |
| - (VFAReturnCode) analyseStream: | (VisageImage *) | frame | |
| withFaceData: | (FaceData *) | faceData | |
| withOptions: | (VFAFlags) | options | |
| withAnalysisData: | (AnalysisData *) | results | |
| withFaceIndex: | (int) | faceIndex | |
Performs the specified face analysis tasks on a given frame and outputs results to an AnalysisData object instance.
This function is primarily intended for performing face analysis on a continuous stream of related frames containing the same person, such as a video or camera feed. Sampling face analysis data from multiple frames can increase estimation accuracy by averaging the result over multiple frames. Internally, the suitability of frames chosen for analysis is continually evaluted based on head pose and overall tracking quality. This guarantees that the analysis buffer is always working with the best available frames, ensuring highest possible estimation accuracy.
Important notes:
This method should only be called with FaceData obtained from a successful tracking operation that returned TRACK_STAT_OK tracking status.
If options parameter is changed between subsequent calls to analyseStream(), the internal state will be reset and previously collected analysis data will be lost. For optimal results options parameter should remain constant during single stream analysis session.
If a new person in the continuous stream replaces the old one, it is neccessary to call resetStreamAnalysis method otherwise results will not be correct as analyseStream() method has no capability of differentiating faces.
| frame | The input grayscale, RGB or RGBA frame. |
| faceData | FaceData obtained by a previous successful tracking operation with VisageTracker (TRACK_STAT_OK). |
| options | Bitwise combination of VFAFlags which determines the analysis operations to be performed |
| results | AnalysisData interface containing success flags for individual operations and their assorted results |
| faceIndex | Index of the face for which analysis should be performed |
| - (VisageFaceAnalyser *) initWithDataPath: | (NSString *) | dataPath |
Constructor.
Initialise VisageFaceAnalyser. This function must be called before using VisageFaceAnalyser by passing it a path to the folder containing the VisageFaceAnalyser data files. Within the visage|SDK package, this folder is Samples/data/vfa*. When implementing applications, developers may copy this folder as part of their application. The path is given relative to the current working directory at the time of calling the init() function.
The VisageFaceAnalyser data folder contains the following subfolders corresponding to the various types of analysis that can be performed:
Note that it is not neccessary for all subfolders to be present, only the ones needed by the types of analysis that will be performed. For example, if only gender estimation will be performed, then only the gd folder is required.
The return value of the init() function indicates which types of analysis have been successfully initialised. Subsqeuent attempt to use a type of analysis that was not initialized shall fail; for example, if only gd folder was present at initialization, attempt to estimate emotions shall fail.
The return value is a bitwise combination of flags indicating which types of analysis are successfully initialized.
| dataPath | relative path from the working directory to the directory that contains VisageFaceAnalyser data files. |
| - (void) resetStreamAnalysis |
Resets age, gender and emotion data for all faces.
This is intended to be used in cases when a new person replaces the old one in the same continous input stream.
| - (void) resetStreamAnalysis: | (int) | faceIndex |
Resets age, gender and emotion data for the specified face index.
This is intended to be used in cases when a new person replaces the old one in the same continous input stream.
1.8.15