Test json output

This commit is contained in:
Ruben 2017-11-12 23:33:12 +01:00
parent 4ab47dcfa4
commit 3e49451996

View file

@ -47,21 +47,29 @@ std::string getAsJson(const std::map<FaceId, Face> faces, const double timeStamp
// << affdex::EmojiToString(f.emojis.dominantEmoji) << ",";
float *values = (float *)&f.measurements.orientation;
for (std::string angle : PlottingImageListener.headAngles)
for (std::string angle : { "pitch", "yaw", "roll" })
{
ss << "'" << angle << "':" << (*values) << ",";
values++;
}
values = (float *)&f.emotions;
for (std::string emotion : PlottingImageListener.emotions)
for (std::string emotion : {
"joy", "fear", "disgust", "sadness", "anger",
"surprise", "contempt", "valence", "engagement"
})
{
ss << "'" << emotion << "':" << (*values) << ",";
values++;
}
values = (float *)&f.expressions;
for (std::string expression : PlottingImageListener.expressions)
for (std::string expression : expressions = {
"smile", "innerBrowRaise", "browRaise", "browFurrow", "noseWrinkle",
"upperLipRaise", "lipCornerDepressor", "chinRaise", "lipPucker", "lipPress",
"lipSuck", "mouthOpen", "smirk", "eyeClosure", "attention", "eyeWiden", "cheekRaise",
"lidTighten", "dimpler", "lipStretch", "jawDrop"
})
{
ss << "'" << expression << "':" << (*values) << ",";
values++;