A Processing library for TheEyeTribe

Forum for development in the Java programming language.

A Processing library for TheEyeTribe

Postby fbie » 04 May 2015, 13:35

Hi everyone,

I'd like to share my Processing library for TheEyeTribe. The idea was to make it extremely convenient to access gaze data for students who do not have a programming background. The underlying implementation has been used in various projects already and seems to be very stable. It does not yet cover any convenient API for calibration, as Jorge's Processing wrapper does, but to get started you only need a very few lines of code.

https://github.com/fbie/libeyetracking

To illustrate, here is the example from GitHub:

Code: Select all
import dk.itu.pitlab.libeyetracking.*;

EyeTracker tracker;

public void setup() {
  size(displayWidth, displayHeight);
  background(0);
  ellipseMode(CENTER);
  smooth();
  tracker = new EyeTracker(this);
}

public void draw() {
  clear();
  noFill();
  strokeWeight(10);

  // Circle is green when tracking, red otherwise.
  if (tracker.isTracking())
    stroke(0, 255, 0);
  else
    stroke(255, 0, 0);

  PVector c = tracker.gazeCoords();
  float ipd = tracker.ipd(); // Inter-pupillary distance.
  float ipd2 = ipd * ipd * ipd * 10000;
  ellipse(c.x, c.y, ipd2, ipd2);
}


Feedback is very much welcome. If you encounter any problems, just file a new Issue on GitHub.

Cheers,
Florian
fbie
 
Posts: 1
Joined: 02 May 2015, 18:58

Return to Java



cron