A really simple eyetracker

Another project that I wanted to share was a really simple-to-build eyetracker.

OLYMPUS DIGITAL CAMERAOLYMPUS DIGITAL CAMERAIt is basically just an old specs-frame with 3 webcams mounted on it – 2 pointing on either eye, the 3rd pointing ahead capturing the subjects field of view. Excuse the cloggy things wrapped in brown tape. They are the voltage regulator circuits for the (formerly internal) display cams that require 3.3V instead of the 5V that your external USB provides:


The eyetracker can sample at ~30Hz (depending on what cameras you use). A drawback is that you need 3 unoccupied USB-ports and your bus or video4linux might not support 3 simultaneous video streams.


The C++ code I wrote uses OpenCV to capture the image frames. During runtime you can calibrate the algorithm as follows:

Click into the window of either eye and draw a ROI (region of interest = blue square) by holding down the left mouse-button. The program will only search for irises with their center within the ROI. When holding down the right mouse-button you can draw a circle that has the approximate size of the iris so that the algorithm knows what kind of circles to search for. Then by clicking on points in the middle view whilst looking at the same points in the real world you can calibrate the program so that it knows what positions of the iris correspond to what positions in the middle view. I’m only using the last 3 calibration points and a perspective transform that does not correct for the spherical shape of the eye. However by mapping the entire field of view and applying some other co-registration function one could probably improve the result a lot. The iris-detection could use improvement as well since I’m only using the ‘HoughCircles’-function; well it’s work in progress. (It would probably be better to detect the pupil instead of the iris anyway.)

However if the calibration went well the blue dot in the middle-image should show where the eye is looking.

Leave a comment

Filed under tech distractions

How to build a cheap 3D-scanner mostly out of spare parts

This paper that I wrote describes how to build a 3D scanner out of parts for less than 60 Euro and parts that were extracted from old printers, notebooks and so forth.

The scanner will be good for scanning a 360° field around its own position at distances of approx. 0.3 to 5 m. So basically this scanner is optimized to scan rooms and objects of a few centimeters up to a couple of meters size. It creates a point cloud that resembles the visible surface of the scanned area as viewed from the position of the scanner.

laser scanner

3D Laserscanner


point cloud of a chair and a mug scanned with the 3D-scanner, the chair casting a ‘shadow’ on the wall behind it


a window board scanned from slightly below with the 3D-scanner


violin on a book scanned with the 3D-scanner


Filed under tech distractions