First time here? Check out the FAQ!

Ask Your Question
0

How to get coordinates?

asked Aug 14 '13

Steve gravatar image

How to get the coordinates of the face?

Hi, according to this tutorial,I am trying to get some information from the faces which will be detected.

Could any body tell me how I can get the coordinates of each circle around the faces?
Is there any prepared source code or tutorial for doing this?

Thank you in advance

Preview: (hide)

1 answer

Sort by » oldest newest most voted
3

answered Aug 15 '13

Moster gravatar image

updated Aug 15 '13

Isnt everything already in the source code?

You have the faces and eyes vector. Those entries include the x, y position and also width and height. The eye position seems to be relative to the face position, so you need to calculate that, but actually its also already in the code.

Point center( faces[i].x + eyes[j].x + eyes[j].width x 0.5, faces[i].y + eyes[j].y + eyes[j].height x 0.5 );

This is the middle/center of the eyes in pixel/image coordinates.

Preview: (hide)

Comments

@StevenPuttemans Thank you for your help. Could you please tell me how I can get the center pixel of the circle (not eyes) as an output?

Steve gravatar imageSteve (Aug 16 '13)edit

StevenPuttemans didnt answer your question. He just edited my answer and changed eyes[j].width * 0.5 to eyes[j].width x 0.5. I dont know why he changed * to x. Btw, what do you mean with circle? Basically that are all circles, around the face, around the eyes.

But the center of the face would be

Point center( faces[i].x + faces[i].width0.5, faces[i].y + faces[i].height0.5 );

Moster gravatar imageMoster (Aug 16 '13)edit

I changed the * because the syntax highlighting takes two following asterixes for italic typing. So i replaced by ;ultiply signs. Please do that in your remark also. Your code isn't logical now.

StevenPuttemans gravatar imageStevenPuttemans (Aug 16 '13)edit

Thank you in advance for your help.

Steve gravatar imageSteve (Aug 16 '13)edit
1

I cant edit it anymore. Its giving me some internal server error.

So here:

Point center( faces[i].x + faces[i].width x 0.5, faces[i].y + faces[i].height x 0.5 );

Moster gravatar imageMoster (Aug 16 '13)edit

Question Tools

Stats

Asked: Aug 14 '13

Seen: 5,090 times

Last updated: Aug 15 '13