Skip to main content

Pupil Labs Camera

ci documentation uv ruff pre-commit pypi version python version

pl-camera banner

This repo contains functionality around the usage of camera intrinsics for undistorting data, projecting and unprojecting points.

It is mostly a wrapper around OpenCV's functionality, providing type hints, input validation, a more intuitive interface, and a few performance optimizations.

Installation

pip install pupil-labs-camera

or

pip install -e git+https://github.com/pupil-labs/pl-camera.git

Quick Start

The following code demonstrates how to use the library in the context of a Neon recording to undistort an image and 2D gaze points. Additional examples can be found in the example Jupyter Notebook.

import cv2

from pupil_labs import neon_recording as nr
from pupil_labs.camera import Camera

recording = nr.NeonRecording(
    "/path/to/recording"
)
camera = Camera(
    pixel_width=1600,
    pixel_height=1200,
    camera_matrix=recording.calibration.scene_camera_matrix,
    distortion_coefficients=recording.calibration.scene_distortion_coefficients,
)

data = zip(recording.scene, recording.gaze.sample(recording.scene.time))

for scene_frame, gaze_sample in data:
    distorted_image = scene_frame.bgr
    undistorted_image = camera.undistort_image(distorted_image)

    distorted_gaze = gaze_sample.point
    undistorted_gaze = camera.undistort_points(distorted_gaze)

    cv2.circle(
        distorted_image,
        tuple(map(int, distorted_gaze)),
        radius=25,
        color=(0, 0, 255),
        thickness=5,
    )

    cv2.circle(
        undistorted_image,
        tuple(map(int, undistorted_gaze)),
        radius=25,
        color=(0, 255, 0),
        thickness=5,
    )

    cv2.imshow("Distorted Image", distorted_image)
    cv2.imshow("Undistorted Image", undistorted_image)
    cv2.waitKey(30)

Metadata

Release files for pupil-labs-camera 1.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pupil-labs-camera 1.2.1
File Size Uploaded Provenance
pupil_labs_camera-1.2.1.tar.gz 1.7 MB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for pupil-labs-camera 1.2.1
File Interpreter ABI Platform
pupil_labs_camera-1.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 1.9 MB

Release files / pupil_labs_camera-1.2.1.tar.gz

Download URL pupil_labs_camera-1.2.1.tar.gz
Size 1.7 MB
Tags Source
SHA-256 checksum
How to use checksums
29cbff5b9c7b31d7e034be8086ceeb5e71d24ed681257625ec97156981781c6f
BLAKE2b-256 checksum
How to use checksums
4c3c2dd77dc52009886dacd6edcb44da2c7cd941be60685bf55a8165fc867743
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 1, 2026.

Transparency log

Release files / pupil_labs_camera-1.2.1-py3-none-any.whl

Download URL pupil_labs_camera-1.2.1-py3-none-any.whl
Size 185.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b3f66bba702ea1a029a7baace5871a9614dfa06489f5b6f9814c24c2ae32e0b0
BLAKE2b-256 checksum
How to use checksums
7cec8fbc0895c4ecfb529d7b9b77fb436434aa50a06b13a5b2683d43ff8e0cd7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 1, 2026.

Transparency log

Security for pupil-labs-camera 1.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for pupil_labs_camera-1.2.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 1, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page