I got this json object from Kairos face detection api:
"landmarks":[
{"leftEyeBrowOuterLeft":{"x":38,"y":76}},
{"leftEyeBrowInnerLeft":{"x":47,"y":74}},
{"leftEyeBrowInnerRight":{"x":56,"y":76}},
{"leftEyeBrowOuterRight":{"x":65,"y":80}},
{"rightEyeBrowOuterLeft":{"x":78,"y":78}},
...
{"lowerLipTopInnerLeft":{"x":68,"y":139}}]
To draw it i don't know how to access the data in another way than this:
var p=json.frames[0]["people"][0]["landmarks"];
context.beginPath();
context.lineTo(p[0].leftEyeBrowOuterLeft.x,p[0].leftEyeBrowOuterLeft.y);
context.lineTo(p[3].leftEyeBrowOuterRight.x,p[3].leftEyeBrowOuterRight.y);
context.stroke();
I guess the best way would be to get rid of the array structure ?! So it would look like this:
...
context.lineTo(p.leftEyeBrowOuterLeft.x,p.leftEyeBrowOuterLeft.y);
...
But how do i rearrange it ?