# How center the eyes of human face at specific pixels?

I am facing a problem with processing some frontal facial images.

I need to adjust the centers of the eyes (irises) to be at certain specific pixels in the image. In other words, i need to transform the image until the centers of the eyes are at specific pixels.

Can anyone help me with this problem, an algorithm, technique, ...etc. that might solve this problem ?

Thanks,

Assuming you can find the centers of the eyes...

1. Rotate - Find the difference of the angle between the actual eyes and your desired angle. Rotate image accordingly.
2. Scale - Find the distance between eyes. Scale according to the desired distance.
3. Translate - Move the image so that one eye lines up. If you've rotated and scaled properly, both should now be in the desired spot.

You can apply homographic transformation to the image, the homography matrix can be estimated using the known positions of the points.

You can use OpenCV for quick implementation.

I found this project very useful.

http://thume.ca/projects/2012/11/04/simple-accurate-eye-center-tracking-in-opencv/

Edit: The project uses image gradients to localize the eye center.

Essentially it uses a heuristic function which assumes that the eye is a circle and thus uses this geometric prior knowledge to estimate the center of the circle, which happens to coincide with the pupuil.

The paper which this is based on can be found here http://www.inb.uni-luebeck.de/publikationen/pdfs/TiBa11b.pdf

• I don't think this is correct. Gaze tracking is about inferring the direction in which the person is looking. This question is about finding the center of the eyes, which is different. The link you give is consistent with that: it says "One of the things necessary for any gaze tracker is accurate tracking of the eye center." - in other words, tracking the location of the center of the eyes is not the same as gaze tracking and is not referred to as gaze tracking.
– D.W.
Commented Jan 7, 2018 at 7:01
• Can you edit your answer to summarize the main ideas from that link? We don't want to be just a link farm; we want to have new content that's useful. Also, if the link stops working, this answer becomes useless -- we want answers that aren't dependent on external links to be useful. Thank you!
– D.W.
Commented Jan 7, 2018 at 7:02
• Thanks for the edit. On this site, rather than writing "X is true. Edit: Actually, X isn't true", we prefer that you edit the answer so that it reads well for someone who encounters it for the first time, and so that it is all correct. There is no need to mark what you've changed. All answers have revision history (which people can view to see what changed, by clicking on the 'edited...' link under the question).
– D.W.
Commented Jan 7, 2018 at 16:28
• This is not exactly what Eye Trackers do (for example some use pupil center corneal reflection) but certainly the article is about tracking the eyes. The article is called "accurate eye centre localisation by means of gradients" (this is important info when the link is not longer valid, as is the attribution), which in my opinion does resolve the problem. I recommend to edit your answer by removing the irrelevant part (gaze tracking is built on solved problem from this question, not the other way around and it is not inverse).
– Evil
Commented Jan 8, 2018 at 3:54
• I edited the post. But which link are no longer valid? They both work for me Commented Jan 8, 2018 at 22:51