You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The text was updated successfully, but these errors were encountered:
TibGva
changed the title
I propose you to draw a rectangle of the BoundingBox and lines between landmarks
I propose you to draw a rectangle of the BoundingBox and lines between Landmarks
Oct 15, 2017
http://docs.aws.amazon.com/fr_fr/rekognition/latest/dg/API_BoundingBox.html
http://docs.aws.amazon.com/fr_fr/rekognition/latest/dg/API_Landmark.html
//rectrangle for face (BoundingBox)
ctx.beginPath();
ctx.lineWidth = '2';
ctx.strokeStyle = 'green';
ctx.rect(
item.BoundingBox.Left * 200,
item.BoundingBox.Top * 200,
item.BoundingBox.Width * 200,
item.BoundingBox.Height * 200);
ctx.stroke();
//line eyes
ctx.beginPath();
ctx.lineWidth = '2';
ctx.strokeStyle = 'red';
ctx.moveTo(item.Landmarks[0].X * 200, item.Landmarks[0].Y * 200);
ctx.lineTo(item.Landmarks[1].X * 200, item.Landmarks[1].Y * 200);
ctx.stroke();
//line mouth
ctx.beginPath();
ctx.lineWidth = '2';
ctx.strokeStyle = 'blue';
ctx.moveTo(item.Landmarks[3].X * 200, item.Landmarks[3].Y * 200);
ctx.lineTo(item.Landmarks[4].X * 200, item.Landmarks[4].Y * 200);
ctx.stroke();
//nose to center eyes
xeyescenter = (item.Landmarks[0].X * 200) + (item.Landmarks[1].X * 200 - item.Landmarks[0].X * 200) / 2;
yeyescenter = (item.Landmarks[0].Y * 200) + (item.Landmarks[1].Y * 200 - item.Landmarks[0].Y * 200) / 2;
ctx.beginPath();
ctx.lineWidth = '2';
ctx.strokeStyle = 'yellow';
ctx.moveTo(xeyescenter, yeyescenter);
ctx.lineTo(item.Landmarks[2].X * 200, item.Landmarks[2].Y * 200);
ctx.stroke();
/*
0- eyeLeft
1- eyeRight
2- nose
3- mouthLeft
4- mouthRight
5- leftEyeBrowLeft
6- leftEyeBrowRight
7- leftEyeBrowUp
8- rightEyeBrowLeft
9- rightEyeBrowRight
10- rightEyeBrowUp
11- leftEyeLeft XXX
12- leftEyeRight
13- leftEyeUp
14- leftEyeDown
15- rightEyeLeft
16- rightEyeRight XXX
17- rightEyeUp
18- rightEyeDown
19- noseLeft
20- noseRight
21- mouthUp
22- mouthDown
23- leftPupil
24- rightPupil
*/
The text was updated successfully, but these errors were encountered: