Attention! This forum will be made read-only by Dec-20. Please migrate to Most of existing active users should've received invitation by e-mail.
Ask Your Question

How to get coordinates?

asked 2013-08-14 17:55:58 -0500

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

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2013-08-15 01:07:37 -0500

Moster gravatar image

updated 2013-08-15 04:29:02 -0500

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.

edit flag offensive delete link more


@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 ( 2013-08-15 18:54:46 -0500 )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 ( 2013-08-16 00:54:45 -0500 )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 ( 2013-08-16 03:09:12 -0500 )edit

Thank you in advance for your help.

Steve gravatar imageSteve ( 2013-08-16 03:51:42 -0500 )edit

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 ( 2013-08-16 03:58:43 -0500 )edit
Login/Signup to Answer

Question Tools


Asked: 2013-08-14 17:55:58 -0500

Seen: 4,215 times

Last updated: Aug 15 '13