new VisageConfiguration(configurationName)
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:
A copy of the VisageTracker internal member can be obtained by calling VisageTracker.getConfiguration() 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:
Following two code examples demonstrate a modification of array type parameters.
Modification of the smoothing_factors parameter:
Modification of the au_names parameter:
VisageTracker provides a method VisageTracker.setConfiguration(VisageConfiguration vc). Usage is demonstrated in the code example below:
The idea behind this interface is for a user to:
- obtain a copy of the VisageConfiguration object from VisageTracker,
- apply the desired changes on the VisageConfiguration object and,
- send the modified object back to the VisageTracker
m_Configuration = new VisageModule.VisageConfiguration(trackerConfigFile)
Obtaining a copy of the VC object
A copy of the VisageTracker internal member can be obtained by calling VisageTracker.getConfiguration() method as demonstrated in the code example below:
var m_Tracker = new VisageModule.VisageTracker(defaultConfigFile);
// Obtain a copy of internal VisageConfiguration member
var m_Configuration = m_Tracker.getConfiguration();
Applying changes on the VC object
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:
- primitive type parameters (Number, String)
- objects of different types (VectorString, Array)
Following code example demonstrates a modification of primitive type parameters by modifying the camera_focus configuration parameter:
// Obtain a copy of internal VisageConfiguration member
m_Configuration = m_Tracker.getConfiguration();
bool success = m_Configuration.setCameraFocus(5.0);
if (success)
//The parameter was changed successfully
else
//The operation failed
Following two code examples demonstrate a modification of array type parameters.
Modification of the smoothing_factors parameter:
// Obtain a copy of internal VisageConfiguration member
m_Configuration = m_Tracker.getConfiguration();
//Get smoothing_factors array from VisageConfiguration.getSmoothingFactors() method
var smoothingFactors = cfg.getSmoothingFactors();
//Change value of the eyebrows smoothing factor
smoothing_factors[0] = 2.0;
bool success = m_Configuration.setSmoothingFactors(smoothing_factors);
if (success)
//The parameter was changed successfully
else
//The operation failed
Modification of the au_names parameter:
// Obtain a copy of internal VisageConfiguration member
m_Configuration = m_Tracker.getConfiguration();
//Create a VectorString object
var au_names = new VisageModule.VectorString();
//Copy returned vector from the VisageConfiguration.getAuNames() method
au_names = m_Configuration.getAuNames();
//Change value of the eyebrows smoothing factor
auNames = [];
//
for(var i = 0; i < size; ++i)
{
auNames[i] = au_names.get(i);
}
auNames[0] = "au_nose";
//
bool success = m_Configuration.setAuNames(auNames);
if (success)
//The parameter was changed successfully
else
//The operation failed
Sending the object to VisageTracker
VisageTracker provides a method VisageTracker.setConfiguration(VisageConfiguration vc). Usage is demonstrated in the code example below:
//Assuming m_Configuration object has been obtained as in example above
m_Tracker.setConfiguration(m_Configuration);
The parameters' values of the sent configuration object will be used in the next tracking session (i.e. when VisageTracker.track() is called).
Parameters:
| Name | Type | Description |
|---|---|---|
configurationName |
string | the name of the tracker configuration file (.cfg; default configuration files are provided in lib folder; for further details see VisageTracker Configuration Manual). |
Methods
-
getCameraFocus() → {Number}
-
Returns the value of the camera_focus parameter.
Returns:
value of the camera_focus parameter.- Type
- Number
-
getRecoveryTimeout() → {Number}
-
Returns the value of the recovery_timeout parameter.
Returns:
value of the recovery_timeout parameter.- Type
- Number
-
getSmoothingFactors() → {Array}
-
Returns the value of the smoothing_factors parameter.
Returns:
containing values of the smoothing_factors parameter.- Type
- Array
-
getEnableSmoothing() → {Number}
-
Returns the value of the enable_smoothing parameter.
Returns:
value of the enable_smoothing parameter.- Type
- Number
-
getTemporallyDenoiseInput() → {Number}
-
Returns the value of the temporally_denoise_input parameter.
Returns:
value of the temporally_denoise_input parameter.- Type
- Number
-
getPoseModelAuCount() → {Number}
-
Returns the number of action units for the pose fitting model.
Returns:
value greater than 0 if the pose model is succesfully loaded.- Type
- Number
-
getAuModelAuCount() → {Number}
-
Returns the number of action units for the action unit fitting model.
Returns:
value greater than 0 if the action model is succesfully loaded.- Type
- Number
-
getMeshModelAuCount() → {Number}
-
Returns the number of action units for the mesh fitting model.
Returns:
value greater than 0 if the action model is succesfully loaded.- Type
- Number
-
getPoseModelSuCount() → {Number}
-
Returns the number of shape units for the pose fitting model.
Returns:
value greater than 0 if the pose model is succesfully loaded.- Type
- Number
-
getAuModelSuCount() → {Number}
-
Returns the number of shape units for the action unit fitting model.
Returns:
value greater than 0 if the action model is succesfully loaded.- Type
- Number
-
getMeshModelSuCount() → {Number}
-
Returns the number of shape units for the mesh fitting model.
Returns:
value greater than 0 if the mesh model is succesfully loaded.- Type
- Number
-
getProcessEyes() → {Number}
-
Returns the value of the process_eyes parameter.
Returns:
value of the process_eyes parameter.- Type
- Number
-
getRefineEars() → {Number}
-
Returns the value of the refine_ears parameter.
Returns:
value of the refine_ears parameter.- Type
- Number
-
getMinFaceScale() → {Number}
-
Returns the value of the min_face_scale parameter.
Returns:
value of the min_face_scale parameter.- Type
- Number
-
getMaxFaceScale() → {Number}
-
Returns the value of the max_face_scale parameter.
Returns:
value of the max_face_scale parameter.- Type
- Number
-
getFaceDetectorSensitivity() → {Number}
-
Returns the value of the face_detector_sensitivity parameter.
Returns:
value of the face_detector_sensitivity parameter.- Type
- Number
-
getPoseFittingModelConfiguration() → {String}
-
Returns the value of the pose_fitting_model_configuration parameter.
Returns:
containing path of the pose_fitting_model_configuration parameter.- Type
- String
-
getAuFittingModelConfiguration() → {String}
-
Returns the value of the au_fitting_model_configuration parameter.
Returns:
containing path of the au_fitting_model_configuration parameter.- Type
- String
-
getMeshFittingModelConfiguration() → {String}
-
Returns the value of the mesh_fitting_model_configuration parameter.
Returns:
containing path of the mesh_fitting_model_configuration parameter.- Type
- String
-
setCameraFocus(camera_focus) → {Boolean}
-
Sets the value of the camera_focus parameter.
Value must be greater than zero.
Parameters:
Name Type Description camera_focusNumber camera_focus value Returns:
True if the parameter was changed, false if the input was invalid- Type
- Boolean
-
setRecoveryTimeout(recovery_timeout) → {Boolean}
-
Sets the value of the recovery_timeout parameter.
Value must be greater than or equal to zero and not a NaN value.
Parameters:
Name Type Description recovery_timeoutNumber recovery_timeout value Returns:
True if the parameter was changed, false if the input was invalid- Type
- Boolean
-
setSmoothingFactors(smoothing_factors) → {Boolean}
-
Sets the values of the smoothing_factors parameter.
Values must not be a NaN value
Parameters:
Name Type Description smoothing_factorsArray smoothing_factors values Returns:
True if the parameter was changed, false if the input was invalid- Type
- Boolean
-
setEnableSmoothing(enable_smoothing) → {Boolean}
-
Sets the value of the enable_smoothing parameter.
Value can only be 0 or 1.
Parameters:
Name Type Description enable_smoothingNumber enable_smoothing value Returns:
True if the parameter was changed, false if the input was invalid- Type
- Boolean
-
setTemporallyDenoiseInput(temporally_denoise_input) → {Boolean}
-
Sets the value of the temporally_denoise_input parameter.
Value can only be 0 or 1.
Parameters:
Name Type Description temporally_denoise_inputNumber temporally_denoise_input value Returns:
True if the parameter was changed, false if the input was invalid- Type
- Boolean
-
setProcessEyes(process_eyes) → {Boolean}
-
Sets the value of the process_eyes parameter.
Value can only be 0, 1, 2, or 3.
Parameters:
Name Type Description process_eyesNumber process_eyes value Returns:
True if the parameter was changed, false if the input was invalid- Type
- Boolean
-
setRefineEars(refine_ears) → {Boolean}
-
Sets the value of the refine_ears parameter.
Value can only be 0 or 1.
Parameters:
Name Type Description refine_earsNumber refine_ears value Returns:
True if the parameter was changed, false if the input was invalid- Type
- Boolean
-
setMinFaceScale(min_face_scale) → {Boolean}
-
Sets the value of the min_face_scale parameter.
Value must be greater than 0.0 and less than or equal to 1.0.
Parameters:
Name Type Description min_face_scaleNumber min_face_scale value Returns:
True if the parameter was changed, false if the input was invalid- Type
- Boolean
-
setMaxFaceScale(max_face_scale) → {Boolean}
-
Sets the value of the max_face_scale parameter.
Value must be greater than 0.0 and less than or equal to 1.0.
Parameters:
Name Type Description max_face_scaleNumber max_face_scale value Returns:
True if the parameter was changed, false if the input was invalid- Type
- Boolean
-
setFaceDetectorSensitivity(face_detector_sensitivity) → {Boolean}
-
Sets the value of the face_detector_sensitivity parameter.
Value must be greater than 0.0 and less than or equal to 1.0.
Parameters:
Name Type Description face_detector_sensitivityNumber face_detector_sensitivity value Returns:
True if the parameter was changed, false if the input was invalid- Type
- Boolean
-
setPoseFittingModelConfiguration(pose_fitting_model_configuration) → {Boolean}
-
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 model will be disabled if the passed string is empty ("") or "none".
NOTE: Changing the model configuration affects the sizes of arrays in the FaceData object populated with values from the model file.
Parameters:
Name Type Description pose_fitting_model_configurationString pose_fitting_model_configuration String path to the model configuration file Returns:
True if the parameter was changed, false if the input file does not exist- Type
- Boolean
-
setAuFittingModelConfiguration(au_fitting_model_configuration) → {Boolean}
-
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 model will be disabled if the passed string is empty ("") or "none".
NOTE: Changing the model configuration affects the sizes of arrays in the FaceData object populated with values from the model file.
Parameters:
Name Type Description au_fitting_model_configurationString au_fitting_model_configuration String path to the model configuration file Returns:
True if the parameter was changed, false if the input file does not exist- Type
- Boolean
-
setMeshFittingModelConfiguration(mesh_fitting_model_configuration) → {Boolean}
-
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 model will be disabled if the passed string is empty ("") or "none".
NOTE: Changing the model configuration affects the sizes of arrays in the FaceData object populated with values from the model file.
Parameters:
Name Type Description mesh_fitting_model_configurationString mesh_fitting_model_configuration String path to the model configuration file Returns:
True if the parameter was changed, false if the input file does not exist- Type
- Boolean
-
enableAuModel()
-
Enables the use of the 3D model used to estimate action units (au_fitting_model_configuration configuration parameter).
-
enableMeshModel()
-
Enables the use of the fine 3D mesh (mesh_fitting_model_configuration configuration parameter).
-
disableAuModel()
-
Disables the use of the 3D model used to estimate action units (au_fitting_model_configuration configuration parameter).
-
disableMeshModel()
-
Disables the use of the fine 3D mesh (mesh_fitting_model_configuration configuration parameter).
-
setUseVNN(use_vnn) → {Boolean}
-
Enables the use of prototype tracking algorithm (use_vnn configuration parameter). Value can be 0, 1, or 2.
Parameters:
Name Type Description use_vnnNumber use_vnn value Returns:
True if the parameter was changed, false if the input was invalid- Type
- Boolean
-
getUseVNN()
-
Returns the value of the use_vnn configuration parameter.