Live Visualization of Gaze Points from Eye Tribe Eye Tracker

Posted on March 18, 2015

When I started working with C++ interface for Eye Tribe (Eye Tracker) I didn't find any example to visualize gaze points Live. However, there are example programs which print GazeData onto console. Hence, I decided to write a wrapper around C++ interface for Eye Tribe to visualize gaze data on a simple console application.

Before I get started, I would like to share my experience working with Eye Tribe.
I had used Eye Trackers from other vendors which are mostly wearable. The issue with wearable Eye Trackers is they can only be used for short studies or some diagnostic tests. However, wearable Eye Trackers are not widely used as a primary means of interacting with a system. The reason is obvious, either wearable Eye Trackers are heavy and/or users feel uneasy wearing these eye trackers while they work on a computer.
Eye Tribe is a game changer in this regard. Once calibrated with a good rating, its accuracy is unquestionable. I have been using Eye Tribe for more than 6 months and never ran into a situation demanding better accuracy. I can go on exalting the capabilities of Eye Tribe, however, this article is created for a different purpose. 

Let's get back to the topic, the goal is to create a Live Gaze Visualizer for Eye Tribe.

The Gaze Visualizer that I have created can be found on GitHub: Live_Tracking_Eye_Tribe

Steps to deploy this project:

Step 1: Download and Install Boost C++ Libraries
  1. Download Boost C++ libraries from here
  2. Version to be used: 1.57.0 or higher
  3. If you are using Windows operating system, follow the instructions on Boost-Getting Started on Windows to understand how to use Boost Libraries.
  4. According to the Boost documentation- "Most Boost libraries are header-only: they consist entirely of header files containing templates and inline functions, and require no separately-compiled library binaries or special treatment when linking."
  5. Only a few libraries have to be built, this can be achieved through "Boost.Build" system.
Step 2: Download or Clone Eye Tribe C++ SDK from GitHub
  1. EyeTribe/tet-cpp-client
  2. You don't have to build any libraries, but all you need to do is include "gazeapi.h" to the project.
Step 3: Handling Graphics
  1. I am assuming that "Visual Studio" is your IDE, and if it is the graphics header "Graphics.h" is not supported.
  2. University of Colorado has implemented a mechanism for using the WinBGIm Graphics Library from Visual Studio (2005/2008 or higher).
  3. Download the WinBGIm Graphics Library from here
  4. You would need two files from "WinBGIM" implementation: Winbgi.cpp, and graphics.h
Step 4: Create Visual Studio Win32 Console Project - Gaze Visualizer
  1. Create a Win32 console project.
  2. Select option "Empty Project, " and don't include any pre-compiled headers.
  3. In project properties set the header paths. In my case it is 
    1. D:\Projects\Git\tet-cpp-client\include\
    2. C:\Program Files\boost\boost_1_57_0\
  4. Under Linker -> General option, set Additional Library Directories
    1. C:\Program Files\boost\boost_1_57_0\stage\lib\
    2. C:\Program Files\boost\boost_1_57_0\libs\
  5. Add source files (*.cpp) from Eye Tribe SDK to the project
  6. Add Winbgi.cpp, and graphics.h to the project
  7. The file "EyeTracker.cpp" (shared on GitHub) implements the Gaze Visualizer.
  8. Built the project.
  9. Connect Eye Tribe to the system, and calibrate.
  10. Run the application and you will see circles drawn on the console showing the Gaze points.
  11. These points are also encoding pupil size.

Writing Task

Watching Video

Feel free to contact me should you have queries.

Leave a Comment: