Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I propose you to draw a rectangle of the BoundingBox and lines between Landmarks #1

Open
TibGva opened this issue Oct 15, 2017 · 0 comments

Comments

@TibGva
Copy link

TibGva commented 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
*/

@TibGva 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant