Pupil Capture: A Beginner’s Guide to Eye-Tracking TechnologyEye tracking has moved from niche laboratories into practical use across research, design, healthcare, and consumer products. Pupil Capture is one of the accessible, open, and flexible tools that brought low-cost eye tracking to broader audiences. This guide explains what Pupil Capture is, how it works, where it’s used, and how to get started — including practical setup, data basics, and best practices for reliable results.
What is Pupil Capture?
Pupil Capture is an open-source eye-tracking platform developed by Pupil Labs that includes wearable hardware (headsets) and companion software for capturing and analyzing eye movements. The platform focuses on transparency and flexibility: hardware designs, firmware, and software are open; users can inspect, modify, and extend them. Pupil Capture is the software component that receives video from the headset(s), computes gaze estimates, records data, and provides a user interface for calibration, visualization, and export.
Key characteristics:
- Open-source software and hardware designs
- Modular and extensible (plugins, scripting)
- Supports both scene-based and remote setups (head-mounted and external cameras)
- Real-time gaze estimation and recording
Basic concepts in eye tracking
- Gaze — the point in space where the eye is directed. Gaze can be reported in pixel coordinates within a world/scene camera frame or mapped to real-world coordinates.
- Fixations — periods where the eye rests on a location (typically 100–600 ms).
- Saccades — quick eye movements between fixations.
- Pupil — the dark central aperture of the iris; pupil center is used to estimate gaze.
- Corneal reflection (CR) / glints — reflections of an infrared light source used to improve gaze estimation in some systems.
- Calibration — mapping of raw eye measurements to gaze points in the scene. Good calibration is essential for accuracy.
How Pupil Capture works (high level)
- Video acquisition: Pupil headsets capture infrared or visible-light video of the eye(s) along with a scene camera that records what the wearer sees.
- Eye feature detection: The software detects the pupil boundary and sometimes corneal reflections using image-processing algorithms.
- Gaze mapping: Using a calibration routine (user looks at known points), the system computes a mapping from pupil features to scene coordinates.
- Real-time display & recording: Estimated gaze is overlaid onto the scene video and recorded along with timestamps, raw pupil metrics, and optional metadata.
- Post-processing/export: Data can be exported in CSV, JSON, or other formats for analysis in Python, MATLAB, R, or specialized gaze-analysis tools.
Hardware overview
Pupil Labs offers different headset models and cameras; community-built mounts and modifications are also common. Typical components:
- Eye cameras: small cameras pointed at each eye, often with infrared illumination for contrast.
- Scene camera: forward-facing camera recording the participant’s field of view.
- Headset/frame: holds cameras in position; available in various sizes for different use cases.
- Computing device: laptop or embedded computer running Pupil Capture (or Pupil Player for playback).
When choosing hardware consider:
- Sampling rate (Hz) — higher rates capture fast eye movements better (e.g., saccades).
- Camera resolution and sensitivity — affects pupil detection robustness.
- Weight and ergonomics — important for long wear or naturalistic tasks.
Software: Pupil Capture features
- Real-time pupil and gaze estimation
- Calibration routines (single- and dual-eye)
- Visualizations: gaze cursors, heatmaps, world video overlays
- Plugin architecture: add-ons for streaming, custom recording, or specialized analysis
- Recording formats: timestamps, pupil raw data, gaze positions, scene video
- Pupil Player: playback and annotation of recorded sessions
Setting up Pupil Capture: step-by-step
- Install software: Download and install Pupil Capture (check compatibility with your OS and the recommended version). Install any required dependencies (Python, OpenCV, etc.) if using source.
- Connect hardware: Attach eye cameras and scene camera to the headset, connect to your computer (USB), and power on any illumination.
- Launch Pupil Capture: Start the application and select the correct camera devices in the settings.
- Camera alignment: Position the headset so eye cameras show the eye centered, with clear pupil contrast. Adjust scene camera for desired field of view.
- Calibration:
- Choose a calibration routine (e.g., 9-point, 5-point).
- Ask the participant to fixate on calibration targets in the scene or on a screen.
- Repeat until mean error is acceptable. Typical acceptable error for mobile setups is ~0.5–2 degrees; lab systems often achieve better accuracy.
- Validate: Use a validation routine to measure accuracy by comparing estimated gaze points against known targets.
- Record: Start recording gaze, scene video, and any additional streams (e.g., external sensors).
- Monitor quality: Watch for dropped frames, poor pupil detection, or shifts in calibration. Recalibrate if needed.
Practical tips for good data
- Lighting: Avoid direct sunlight or variable lighting that causes reflections or shadows. Infrared LEDs used by the headset are more robust in controlled lighting.
- Fit and comfort: A stable headset fit reduces slippage and calibration drift.
- Minimize head movement if high precision is needed — or use robust mapping methods that handle movement.
- Blink handling: Blinks remove pupil visibility; design tasks to tolerate brief data loss or filter blinks during analysis.
- Frequent recalibration: Recalibrate after headset adjustments, long tasks, or if accuracy degrades.
- Synchronization: If combining with other data streams (EEG, motion capture), ensure timestamps are synchronized.
Calibration and accuracy: what to expect
Calibration maps eye features to scene coordinates and is the largest determinant of gaze accuracy. Expect:
- Mobile head-mounted setups: typical accuracy ~0.5°–2° of visual angle depending on headset, environment, and participant.
- Desktop remote systems (high-end): often better than 0.5°.
- Accuracy varies across the scene — peripheral areas often show larger errors.
- Precision (consistency) and accuracy (systematic offset) are different; both matter for analysis.
Common applications
- UX and usability testing: where users look on websites, apps, or physical products.
- Psychology and cognitive science: attention, reading, memory, visual search studies.
- Human factors and ergonomics: driver attention, cockpit interface design.
- Accessibility: gaze-based interaction and assistive tech.
- Virtual reality (VR) and augmented reality (AR): foveated rendering, attention-aware interfaces.
- Clinical and healthcare research: diagnostic indicators, rehabilitation.
Data formats and basic analysis
Pupil Capture records gaze samples, pupil size, timestamps, and scene video. Typical analysis steps:
- Preprocessing: filter blinks, remove noisy samples, resample to uniform rate.
- Event detection: identify fixations and saccades (e.g., velocity- or dispersion-based algorithms).
- AOI (Area of Interest) analysis: map gaze points to regions (buttons, text blocks) and compute dwell time, entry count.
- Heatmaps and scanpaths: visualize aggregated attention and sequence of fixations.
- Statistical tests: compare groups, conditions, or time epochs.
Example tools for analysis:
- Python: pandas, numpy, matplotlib/plotly, PyGaze, Pupil Labs’ own analysis libraries.
- MATLAB: statistical and signal-processing toolboxes.
- R: tidyverse, eyetrackingR.
Troubleshooting common problems
- No pupil detected: check IR illumination, camera focus, eye occlusion (glasses, eyelashes), and camera positioning.
- Poor calibration: ensure participant follows calibration targets precisely, reduce head movement, use more calibration points.
- Flicker or dropped frames: try different USB ports, reduce other camera streams, lower scene camera resolution.
- Large offsets: re-run calibration, check for headset slippage, verify correct camera selection.
Ethics and privacy
Eye-tracking reveals attention and can infer cognitive states. Consider:
- Informed consent: explain what data is recorded and how it will be used.
- Data minimization: record only needed streams and metadata.
- Secure storage: anonymize participant identifiers and store data securely.
Learning resources and community
- Pupil Labs documentation and GitHub repositories for source code, drivers, and plugins.
- Tutorials and forums where researchers and developers share tips, scripts, and modifications.
- Academic papers and online courses on eye-tracking methods and analysis.
Closing notes
Pupil Capture is a practical entry point to eye tracking: open, flexible, and well suited for research and applied projects. Success depends on careful setup, good calibration practices, thoughtful experimental design, and appropriate analysis pipelines. With attention to these steps you can collect meaningful gaze data that reveal where and how people look in naturalistic and controlled tasks.
Leave a Reply