|
visageSDK
|
VisageConfiguration is a class used to change, apply, load and save configuration parameters used by VisageTracker. More...
#include <VisageConfiguration.h>
Public Member Functions | |
| VisageConfiguration (const char *trackerConfigFile) | |
| Constructor. More... | |
| VisageConfiguration (const VisageConfiguration &configuration) | |
| Copy constructor. More... | |
| float | getCameraFocus () const |
| Returns the value of the camera_focus parameter. More... | |
| float | getRecoveryTimeout () const |
| Returns the value of the recovery_timeout parameter. More... | |
| VsCfgArr< float > | getSmoothingFactors () const |
| Returns the value of the smoothing_factors parameter. More... | |
| unsigned int | getEnableSmoothing () const |
| Returns the value of the enable_smoothing parameter. More... | |
| unsigned int | getTemporallyDenoiseInput () const |
| Returns the value of the temporally_denoise_input parameter. More... | |
| const std::string & | getVftDataPath () const |
| Returns the value of the vft_data_path parameter. More... | |
| const std::string & | getVfdDataPath () const |
| Returns the value of the vfd_data_path parameter. More... | |
| const std::string & | getPrDataPath () const |
| Returns the value of the pr_data_path parameter. More... | |
| const std::string & | getErDataPath () const |
| Returns the value of the er_data_path parameter. More... | |
| unsigned int | getProcessEyes () const |
| Returns the value of the process_eyes parameter. More... | |
| unsigned int | getRefineLandmarks () const |
| Returns the value of the refine_landmarks parameter. More... | |
| unsigned int | getRefineEars () const |
| Returns the value of the refine_ears parameter. More... | |
| float | getMinFaceScale () const |
| Returns the value of the min_face_scale parameter. More... | |
| float | getMaxFaceScale () const |
| Returns the value of the max_face_scale parameter. More... | |
| float | getFaceDetectorSensitivity () const |
| Returns the value of the face_detector_sensitivity parameter. More... | |
| const std::string & | getPoseFittingModelConfiguration () const |
| Returns the value of the pose_fitting_model_configuration parameter. More... | |
| const std::string & | getAuFittingModelConfiguration () const |
| Returns the value of the au_fitting_model_configuration parameter. More... | |
| const std::string & | getMeshFittingModelConfiguration () const |
| Returns the value of the mesh_fitting_model_configuration parameter. More... | |
| bool | setCameraFocus (float camera_focus) |
| Sets the value of the camera_focus parameter. More... | |
| bool | setRecoveryTimeout (float recovery_timeout) |
| Sets the value of the recovery_timeout parameter. More... | |
| bool | setSmoothingFactors (const VsCfgArr< float > &smoothing_factors) |
| Sets the values of the smoothing_factors parameter. More... | |
| bool | setEnableSmoothing (unsigned int enable_smoothing) |
| Sets the values of the enable_smoothing parameter. More... | |
| bool | setTemporallyDenoiseInput (unsigned int temporally_denoise_input) |
| Sets the values of the temporally_denoise_input parameter. More... | |
| bool | setVftDataPath (std::string vft_data_path) |
| Sets the value of the vft_data_path parameter. More... | |
| bool | setVfdDataPath (std::string vfd_data_path) |
| Sets the value of the vfd_data_path parameter. More... | |
| bool | setPrDataPath (std::string pr_data_path) |
| Sets the value of the pr_data_path parameter. More... | |
| bool | setErDataPath (std::string er_data_path) |
| Sets the value of the er_data_path parameter. More... | |
| bool | setProcessEyes (unsigned int process_eyes) |
| Sets the value of the process_eyes parameter. More... | |
| bool | setRefineLandmarks (unsigned int refine_landmarks) |
| Sets the value of the refine_landmarks parameter. More... | |
| bool | setRefineEars (unsigned int refine_ears) |
| Sets the value of the refine_ears parameter. More... | |
| bool | setMinFaceScale (float min_face_scale) |
| Sets the value of the min_face_scale parameter. More... | |
| bool | setMaxFaceScale (float max_face_scale) |
| Sets the value of the max_face_scale parameter. More... | |
| bool | setFaceDetectorSensitivity (float face_detector_sensitivity) |
| Sets the value of the face_detector_sensitivity parameter. More... | |
| bool | setPoseFittingModelConfiguration (std::string pose_fitting_model_configuration) |
| Sets the value of the pose_fitting_model_configuration parameter. More... | |
| bool | setAuFittingModelConfiguration (std::string au_fitting_model_configuration) |
| Sets the value of the au_fitting_model_configuration parameter. More... | |
| bool | setMeshFittingModelConfiguration (std::string mesh_fitting_model_configuration) |
| Sets the value of the mesh_fitting_model_configuration parameter. More... | |
| void | enableAuModel () |
| Enables the use of the 3D model used to estimate action units (au_fitting_model_configuration configuration parameter). | |
| void | enableMeshModel () |
| Enables the use of the fine 3D mesh (mesh_fitting_model_configuration configuration parameter). | |
| void | disableAuModel () |
| Disables the use of the 3D model used to estimate action units (au_fitting_model_configuration configuration parameter). | |
| void | disableMeshModel () |
| Disables the use of the fine 3D mesh (mesh_fitting_model_configuration configuration parameter). | |
| bool | setConfigurationFile (const char *trackerConfigFile) |
| Reads and loads values from a specified configuration (*.cfg) file. More... | |
| VisageConfiguration & | operator= (VisageConfiguration configuration) |
| Copy assignment operator. More... | |
VisageConfiguration is a class used to change, apply, load and save configuration parameters used by VisageTracker.
The idea behind this interface is for a user to:
As a direct result of this implementation, the VisageConfiguration default constructor is private and it is expected and encouraged that the initial copy is obtained from the VisageTracker. Alternatively, VisageConfiguration can also be constructed by passing a path to the valid .cfg file using VisageConfiguration::VisageConfiguration(const char* trackerConfigFile).
Setting and getting of the VisageConfiguration object is thread-safe, i.e. methods can be invoked from another thread.
A copy of the VisageTracker internal member can be obtained by calling VisageTracker::getTrackerConfiguration() method as demonstrated in the code example below:
The interface of the VisageConfiguration class is designed so the parameters cannot be accessed directly, instead, each parameter has its own getter and setter function. After a local copy is obtained, a setter function can be called. Setter functions perform input validation to verify that the value passed to the function is: a) within a certain range, b) not empty, or c) otherwise valid. Thus, the return parameter of the setter function is a boolean and if the value passed as an argument is invalid, the setter function will return false. Otherwise, if the value of the parameter was successfully changed, the function will return true.
A detailed description of each particular configuration parameter, including valid ranges and other specifics, are available in the VisageTracker Configuration Manual.
Parameters of the VisageConfiguration class can be divided into two categories:
Following code example demonstrates a modification of primitive type parameters by modifying the camera_focus configuration parameter:
A new template struct, VsCfgArr, has been introduced for storing array-type parameters. This structure can hold arrays of various types including short, integer, float, double and string. VsCfgArr is used exclusively in conjunction with VisageConfiguration interface.
Following code example demonstrates a modification of array-type parameters by modifying the smoothing_factors configuration parameter:
See the detailed page of the VsCfgArr structure for code examples demonstrating:
Once the changes have been applied, the local copy needs to be applied to the tracker for the changes to take effect.
VisageTracker provides an overloaded method VisageTracker::setTrackerConfiguration(VisageConfiguration& vc). A reference of the local object is passed to the VisageTracker and copied to the internal member. Usage is demonstrated in the code example below:
The parameters' values of the sent configuration object will be used in the next tracking session (i.e. when VisageTracker::track() is called).
Definition at line 272 of file VisageConfiguration.h.
| VisageSDK::VisageConfiguration::VisageConfiguration | ( | const char * | trackerConfigFile | ) |
Constructor.
Creates a new instance of the VisageConfiguration class by reading a specified configuration (*.cfg) file.
| trackerConfigFile | Path to a specified configuration (*.cfg) file. |
| VisageSDK::VisageConfiguration::VisageConfiguration | ( | const VisageConfiguration & | configuration | ) |
Copy constructor.
Creates a new instance of the VisageConfiguration class by copying an already existing instance.
| configuration | Reference to pre-existing VisageConfiguration object. |
| const std::string& VisageSDK::VisageConfiguration::getAuFittingModelConfiguration | ( | ) | const |
Returns the value of the au_fitting_model_configuration parameter.
| float VisageSDK::VisageConfiguration::getCameraFocus | ( | ) | const |
Returns the value of the camera_focus parameter.
| unsigned int VisageSDK::VisageConfiguration::getEnableSmoothing | ( | ) | const |
Returns the value of the enable_smoothing parameter.
| const std::string& VisageSDK::VisageConfiguration::getErDataPath | ( | ) | const |
Returns the value of the er_data_path parameter.
| float VisageSDK::VisageConfiguration::getFaceDetectorSensitivity | ( | ) | const |
Returns the value of the face_detector_sensitivity parameter.
| float VisageSDK::VisageConfiguration::getMaxFaceScale | ( | ) | const |
Returns the value of the max_face_scale parameter.
| const std::string& VisageSDK::VisageConfiguration::getMeshFittingModelConfiguration | ( | ) | const |
Returns the value of the mesh_fitting_model_configuration parameter.
| float VisageSDK::VisageConfiguration::getMinFaceScale | ( | ) | const |
Returns the value of the min_face_scale parameter.
| const std::string& VisageSDK::VisageConfiguration::getPoseFittingModelConfiguration | ( | ) | const |
Returns the value of the pose_fitting_model_configuration parameter.
| const std::string& VisageSDK::VisageConfiguration::getPrDataPath | ( | ) | const |
Returns the value of the pr_data_path parameter.
| unsigned int VisageSDK::VisageConfiguration::getProcessEyes | ( | ) | const |
Returns the value of the process_eyes parameter.
| float VisageSDK::VisageConfiguration::getRecoveryTimeout | ( | ) | const |
Returns the value of the recovery_timeout parameter.
| unsigned int VisageSDK::VisageConfiguration::getRefineEars | ( | ) | const |
Returns the value of the refine_ears parameter.
| unsigned int VisageSDK::VisageConfiguration::getRefineLandmarks | ( | ) | const |
Returns the value of the refine_landmarks parameter.
| VsCfgArr<float> VisageSDK::VisageConfiguration::getSmoothingFactors | ( | ) | const |
Returns the value of the smoothing_factors parameter.
| unsigned int VisageSDK::VisageConfiguration::getTemporallyDenoiseInput | ( | ) | const |
Returns the value of the temporally_denoise_input parameter.
| const std::string& VisageSDK::VisageConfiguration::getVfdDataPath | ( | ) | const |
Returns the value of the vfd_data_path parameter.
| const std::string& VisageSDK::VisageConfiguration::getVftDataPath | ( | ) | const |
Returns the value of the vft_data_path parameter.
| VisageConfiguration& VisageSDK::VisageConfiguration::operator= | ( | VisageConfiguration | configuration | ) |
Copy assignment operator.
Copies the values of one VisageConfiguration object to another.
| configuration | VisageConfiguration object to copy values from |
| bool VisageSDK::VisageConfiguration::setAuFittingModelConfiguration | ( | std::string | au_fitting_model_configuration | ) |
Sets the value of the au_fitting_model_configuration parameter.
This function sets the .cfg (au_fitting_model_configuration) file used for action unit fitting. The path to the model configuration must be relative to the configuration file used for tracker initialization. The model will be disabled if the passed string is empty ("") or "none".
NOTE: Changing the model configuration may affect the sizes of arrays in the FaceData object populated with values from the model file.
| au_fitting_model_configuration | String path to the model file |
| bool VisageSDK::VisageConfiguration::setCameraFocus | ( | float | camera_focus | ) |
Sets the value of the camera_focus parameter.
Value must be greater than zero.
| camera_focus | Float value |
| bool VisageSDK::VisageConfiguration::setConfigurationFile | ( | const char * | trackerConfigFile | ) |
Reads and loads values from a specified configuration (*.cfg) file.
| trackerConfigFile | Path to a configuration (*.cfg) file |
| bool VisageSDK::VisageConfiguration::setEnableSmoothing | ( | unsigned int | enable_smoothing | ) |
Sets the values of the enable_smoothing parameter.
Value can be 0 or 1.
| enable_smoothing | Integer value |
| bool VisageSDK::VisageConfiguration::setErDataPath | ( | std::string | er_data_path | ) |
Sets the value of the er_data_path parameter.
The path must be relative to the configuration file used for tracker initialization and not empty.
| er_data_path | String path to the folder containing ears' refinement data files |
| bool VisageSDK::VisageConfiguration::setFaceDetectorSensitivity | ( | float | face_detector_sensitivity | ) |
Sets the value of the face_detector_sensitivity parameter.
Value must be greater than 0.0 and less than or equal to 1.0.
| face_detector_sensitivity | Float value |
| bool VisageSDK::VisageConfiguration::setMaxFaceScale | ( | float | max_face_scale | ) |
Sets the value of the max_face_scale parameter.
Value must be greater than 0.0 and less than or equal to 1.0.
| max_face_scale | Float value |
| bool VisageSDK::VisageConfiguration::setMeshFittingModelConfiguration | ( | std::string | mesh_fitting_model_configuration | ) |
Sets the value of the mesh_fitting_model_configuration parameter.
This function sets the .cfg (mesh_fitting_model_configuration) file used for mesh fitting. The path to the model configuration must be relative to the configuration file used for tracker initialization. The model will be disabled if the passed string is empty ("") or "none".
NOTE: Changing the model configuration may affect the sizes of arrays in the FaceData object populated with values from the model file.
| mesh_fitting_model_configuration | String path to the model file |
| bool VisageSDK::VisageConfiguration::setMinFaceScale | ( | float | min_face_scale | ) |
Sets the value of the min_face_scale parameter.
Value must be greater than 0.0 and less than or equal to 1.0.
| min_face_scale | Float value |
| bool VisageSDK::VisageConfiguration::setPoseFittingModelConfiguration | ( | std::string | pose_fitting_model_configuration | ) |
Sets the value of the pose_fitting_model_configuration parameter.
This function sets the .cfg (pose_fitting_model_configuration) file used for pose fitting. The path to the model configuration must be relative to the configuration file used for tracker initialization. The model will be disabled if the passed string is empty ("") or "none".
NOTE: Changing the model configuration may affect the sizes of arrays in the FaceData object populated with values from the model file.
| pose_fitting_model_configuration | String path to the model file |
| bool VisageSDK::VisageConfiguration::setPrDataPath | ( | std::string | pr_data_path | ) |
Sets the value of the pr_data_path parameter.
The path must be relative to the configuration file used for tracker initialization and not empty.
| pr_data_path | String path to the folder containing pupils' refinement data files |
| bool VisageSDK::VisageConfiguration::setProcessEyes | ( | unsigned int | process_eyes | ) |
Sets the value of the process_eyes parameter.
Value can only be 0, 1, 2, or 3.
| process_eyes | Integer value |
| bool VisageSDK::VisageConfiguration::setRecoveryTimeout | ( | float | recovery_timeout | ) |
Sets the value of the recovery_timeout parameter.
Value must be greater than or equal to zero and not a NaN value.
| recovery_timeout | Float value |
| bool VisageSDK::VisageConfiguration::setRefineEars | ( | unsigned int | refine_ears | ) |
Sets the value of the refine_ears parameter.
Value can only be 0 or 1.
| refine_ears | Integer value |
| bool VisageSDK::VisageConfiguration::setRefineLandmarks | ( | unsigned int | refine_landmarks | ) |
Sets the value of the refine_landmarks parameter.
Value can be 0 or 1.
| refine_landmarks | Integer value |
| bool VisageSDK::VisageConfiguration::setSmoothingFactors | ( | const VsCfgArr< float > & | smoothing_factors | ) |
Sets the values of the smoothing_factors parameter.
Values must not be a NaN value.
| smoothing_factors | Reference to a VsCfgArr containing float values |
| bool VisageSDK::VisageConfiguration::setTemporallyDenoiseInput | ( | unsigned int | temporally_denoise_input | ) |
Sets the values of the temporally_denoise_input parameter.
Value can be 0 or 1.
| temporally_denoise_input | Integer value |
| bool VisageSDK::VisageConfiguration::setVfdDataPath | ( | std::string | vfd_data_path | ) |
Sets the value of the vfd_data_path parameter.
The path must be relative to the configuration file used for tracker initialization and not empty.
| vfd_data_path | String path to the folder containing algorithm data file required by tracker and detector |
| bool VisageSDK::VisageConfiguration::setVftDataPath | ( | std::string | vft_data_path | ) |
Sets the value of the vft_data_path parameter.
The path must be relative to the configuration file used for tracker initialization and not empty.
| vft_data_path | String path to the folder containing tracking algorithm data files required by tracker |
1.8.10