ISETCam PSF representations - ISET/isetcam GitHub Wiki
Many ISETCam calculations use a shift-invariant optical model: the image of a point in the scene spreads by the same amount in the optical image no matter where the point is, though the amount of spread — the point spread function (PSF) — varies with wavelength. The image region over which this shift-invariant approximation holds well for a given lens is called its isoplanatic region.
In general the true PSF depends on the point's position in the scene, both its field height (distance from the image center) and, importantly, its distance from the lens. The shift-invariant approximation works well for many practical cases: scenes with a modest field of view (around 20 degrees) with objects at roughly the same distance, or scenes where all the objects are far enough away that the PSF changes little beyond some distance (about 10-20 focal lengths, for the human eye or a classical double-Gauss lens).
The PSF is a property of the optics, so ISETCam describes it with
parameters in the optics structure. Starting in 2023, ISETCam represents
this information as wavefront aberrations rather than storing the PSF
or its Fourier transform (the OTF) directly. The wavefront aberration is
stored as a set of polynomial coefficients using the international-standard
Zernike representation
over the disk; individual polynomial terms correspond to aberrations with
recognizable names, such as defocus and vertical astigmatism.
The PSF itself is not stored — it is computed from the Zernike
coefficients on the fly, inside oiCompute (via opticsPSF), at the
spatial sampling resolution the current scene and optical image require.
The value of the polynomial representation is that it is continuous, so
ISETCam can always regenerate a correctly sampled PSF rather than
interpolating a PSF that was pre-computed at some other, possibly
mismatched, resolution.
For many years ISETCam represented optics as OTFs (optical transfer functions) sampled at a fixed set of spatial frequencies, built from the f-number of a diffraction-limited lens. When a scene needed different spatial frequencies than the stored samples, ISETCam interpolated the stored OTF. Around 2023, small interpolation errors were found to matter when rendering flare in very high-dynamic-range scenes, even though they were negligible for most calculations. Switching to the Zernike/wavefront representation removed this interpolation error (at the cost of some extra computation, rebuilding the PSF from scratch for each scene) — a trade-off that improved accuracy enough, on faster modern hardware, to be worthwhile.
ISETCam has a large family of functions to create, set, get, and plot the
wavefront representation (wvf<TAB>).
An important special case is the perfect, shift-invariant lens with a
circular aperture and no aberrations (all Zernike coefficients zero). Its
PSF, called the Airy disk, has a closed-form solution that depends only
on the lens f-number (the ratio of focal length to aperture diameter).
ISETCam can compute this either by zeroing the wavefront (the general
opticsPSF path) or with the explicit Airy-disk formula, which is faster
and used for quick, approximate calculations; see
Optics and Optical Images
for how the two compare.
Back to Optics and Optical Images.