Foreshortening#
- class pypillometry.sim.Foreshortening(eye_offset=0.0)[source]#
Bases:
SimStepPupil foreshortening: the camera sees the pupil at the angle \(\alpha\) between the directions from the eye to the camera and to the gaze position, so that the measured size is \(A_0 \cos\alpha\). Needs the gaze (e.g.,
Fixations) and an experimental setup with screen, eye distance and camera position.- Parameters:
eye_offset (
float) – horizontal offset of the eye from the screen centre (mm)
Notes
Ground truth per eye:
cosalpha.Examples
The measured pupil is smaller than the true size, and jumps with the gaze:
>>> import pypillometry as pp >>> import matplotlib.pyplot as plt >>> setup = pp.ExperimentalSetup(screen_resolution=(1920, 1080), ... physical_screen_size=("52 cm", "29 cm"), ... eye_to_screen_center="60 cm", ... camera_spherical=("20 deg", "-90 deg", "70 cm")) >>> d = (pp.sim.Simulation("10 s", fs=100, seed=1, setup=setup, name="Foreshortening") ... .pupil().gaze().foreshortening().units(800).run()) >>> fig, ax = plt.subplots(figsize=(8, 3), layout="constrained") >>> ax = d.plot.plot_truth(ax=ax)
Methods
change the arrays of the running simulation run
the eyes of the simulation the step applies to
the step from
to_dict()the events and the duration (ms), for steps of stage
"events"name and parameters of the step (numbers, strings, lists, dicts)
Details
- generate(rng)#
the events and the duration (ms), for steps of stage
"events"