I want to track a single eye in Opencv in cpp . i will be using a head mount camera [normal / ir camera], i have tried different algorithms but every code is related to head pose estimation technique . Can anyone suggest any algorithm with code or way to implement
-
You can try using dlib – aram Jan 22 '18 at 18:53
-
@Aram dlib is working on head pose algorithm i have tries to use face landmarks on eye to track but using dlib i am unable to detect face landmark on eye can u suggest any other method – Cherala Vivek Jan 22 '18 at 18:55
-
Are you trying to track gaze direction / pupil tracking? Is the eye in a fixed location/orientation in the video frame? – BHawk Jan 22 '18 at 19:27
-
@BHawk pupil tracking for single eye – Cherala Vivek Jan 22 '18 at 19:29
-
@BHawk can u suggest or share any other code regarding pupil tracking or track gaze direction – Cherala Vivek Jan 23 '18 at 05:03
-
You need to include a sample image and your current code if you want to get useful answers to this. – BHawk Jan 23 '18 at 16:48
2 Answers
If the eye is in a fixed location in the video than finding the eye isn't the problem, so all you need to do is perform the pupil tracking. I'd recommend checking out this paper, it's a bit old but doesn't require any machine learning or complex math:
http://www.inb.uni-luebeck.de/publikationen/pdfs/TiBa11b.pdf
It details a fairly simple and fast method for finding a pupil quickly given an image or region of interest of an eye.
Also, just found this if you just want to rip off somebody's code:
http://thume.ca/projects/2012/11/04/simple-accurate-eye-center-tracking-in-opencv/
It is a c++ implementation of the same algorithm.

- 2,382
- 1
- 16
- 24
-
The code which u have send works on head pose algorithm , i have tried it and its not working for single eye pupil tracking – Cherala Vivek Jan 23 '18 at 05:01
-
The head pose is only used to extract the eye location. You don't need the eye location because you know where the eye is in your image. So just use the second part of the code. The part that actually processes the eye region. Skip the head pose part. – BHawk Jan 23 '18 at 16:47
If you want you can use the haar cascade implemetation To perform a single eye tracking you can track faces and eyes , using the classifier that returns boxes'coordinates where faces and eyes are in the image and checking when a eye is in the face's block you can determinate each pair of eyes for each face.Then you can choose which eye to show for every face
Here the link that show how to use the cascade classifiers.
Here the file that you need for use the cascadeclassifier Here if you are interested some papers that explains some tracking algorithms in computer vision.

- 661
- 5
- 21
-
i am using head mount camera and only single eye is visible through camera . The camera view is restricted to only single eye – Cherala Vivek Jan 23 '18 at 04:59