new VectorFloat()
Custom container class for numbers.
For example, used in conjunction with VisageFaceAnalayser.estimateEmotion() function.
Sample usage:
For example, used in conjunction with VisageFaceAnalayser.estimateEmotion() function.
Sample usage:
function onEstimateEmotion()
{
//create new empty container object
emotions = new VisageModule.VectorFloat();
//pass the empty container to be filed by the estimateEmotion function
estimatedEmotion = visageFaceAnalyser.estimateEmotion(mWidth, mHeight, ppixels, faceDataArray.get(0), emotions);
if (estimatedEmotion == 1)
{
//fetch values from the container object
var anger = emotions.get(0);
var disgust = emotions.get(1);
var fear = emotions.get(2);
var happiness = emotions.get(3);
var sadness = emotions.get(4);
var surprise = emotions.get(5);
var neutral = emotions.get(6);
}
//Clean-up
emotions.delete();
}
Methods
-
push_back(number)
-
Add number to vector.
Parameters:
Name Type Description number
number number to be added. -
get(index) → {number}
-
Get number from the vector specified by index parameter.
Parameters:
Name Type Description index
number position of the number in the vector. Returns:
number located on the location specified by index parameter- Type
- number
-
delete()
-
Release the memory allocated to the VectorFloat object.