A webcam based pupil tracking implementation.
Clone or download
trishume Merge pull request #19 from PlasmaTonmai/for-mac
change VideoCapture -1 to 0 for mac driver
Latest commit d23087a Oct 17, 2017
Type Name Latest commit message Commit time
Failed to load latest commit information.
res Initial commit Oct 20, 2012
src change VideoCapture -1 to 0 for mac driver Oct 16, 2017
.gitignore Initial commit Oct 20, 2012
CMakeLists.txt Support OpenCV 3.0 Feb 27, 2016
LICENSE Added license Jun 28, 2013
Readme.md Fix some formatting issues in readme May 12, 2017
cmakeBuild.sh Initial commit Oct 20, 2012



An OpenCV based webcam gaze tracker based on a simple image gradient-based eye center algorithm by Fabian Timm.


This does not track gaze yet. It is basically just a developer reference implementation of Fabian Timm's algorithm that shows some debugging windows with points on your pupils.

If you want cheap gaze tracking and don't mind hardware check out The Eye Tribe. If you want webcam-based eye tracking contact Xlabs or use their chrome plugin and SDK. If you're looking for open source your only real bet is Pupil but that requires an expensive hardware headset.


The eye center tracking works well but I don't have a reference point like eye corner yet so it can't actually track where the user is looking.

If anyone with more experience than me has ideas on how to effectively track a reference point or head pose so that the gaze point on the screen can be calculated contact me.


CMake is required to build eyeLike.

OSX or Linux with Make

# do things in the build directory so that we don't clog up the main directory
mkdir build
cd build
cmake ../
./bin/eyeLike # the executable file

On OSX with XCode

mkdir build

then open the XCode project in the build folder and run from there.

On Windows

There is some way to use CMake on Windows but I am not familiar with it.

Blog Article:


Timm and Barth. Accurate eye centre localisation by means of gradients. In Proceedings of the Int. Conference on Computer Theory and Applications (VISAPP), volume 1, pages 125-130, Algarve, Portugal, 2011. INSTICC.

(also see youtube video at http://www.youtube.com/watch?feature=player_embedded&v=aGmGyFLQAFM)