Skip to content

Optics Models

Brian Wandell edited this page Sep 17, 2024 · 34 revisions

ISETCam includes two basic optical models. These are designed to work with planar surfaces, or equivalently objects at a relatively far distance. For many applications and experiments, the optical models in ISETCam are sufficient and almost always useful approximations. For more complex optical computations, that include depth of field and complex multi-element lenses, we use ISET3d-tiny.

The most commonly used optical model approximates the optics as shift-invariant. This means that the point spread function is the same across all visual field positions. The model is wavelength-dependent: the point spread function can be different for every wavelength. The point spread function is defined in the optical image by a wavefront aberration function. The wavelength-dependent wavefront function is stored in the optics subfield within the OI struct.

An important, special case of the shift-invariant model, the diffraction limited optics, is the special case of an aberration free wavefront model (the wavefront is all zeros). We can compute this model in two ways. One is by simply setting the wavefront to all zeros. We also can implement this calculation using the explicit mathematical form of the diffraction limited point spread. These two calculations produce virtually identical values, and we retain the diffraction limited case mainly because it is fast. The diffraction limited implementation is (slightly) less accurate: there is a meaningful difference between the wavefront and diffraction limited models for high dynamic range scenes that model flare (see isethdrsensor).

A second model (ray trace) uses a point spread function that varies with position in the visual field (shift-varying). In this case we have a wavelength-dependent point spread function that changes with field height. The ray trace model also calculating lens geometric distortion. The data for the shift-varying model are typically extracted from lens design software, such as Zemax or Code V (see this repository).

Finally, we implemented a ray trace calculation that applies to three-dimensional scenes in ISET3d-tiny. That software uses multi-element lens prescriptions of the certain optics (spherical and biconvenx lenses). It uses ray tracing software (PBRT) to model the optics.

On this page, we provide a brief overview of these different optics calculations. The links take you to pages that provide more details about the calculations.

Optical image (OI)

The imaging lens transforms the scene radiance into the irradiance at the sensor surface. We call this the optical image (oi). The oi structure contains information about the optical image and the optics.

>> scene = sceneCreate; oi = oiCreate('wvf'); oi = oiCompute(oi,scene,'crop',true);
>> oi

oi = 

  struct with fields:

             type: 'opticalimage'
             name: 'Macbeth (D65)'
         metadata: []
         diffuser: [1×1 struct]
         spectrum: [1×1 struct]
           optics: [1×1 struct]
    computeMethod: 'opticspsf'
         wAngular: 10.0321
             data: [1×1 struct]
         depthMap: [80×120 double]

>> 

The information about the imaging lens optics is in oi.optics. Here is the optics slot for this wavefront defined, shift-invariant optics

>> oi.optics

ans = 

  struct with fields:

             type: 'optics'
             name: 'wvf'
          offaxis: 'cos4th'
       vignetting: 0
              wvf: [1×1 struct]
            model: 'shiftinvariant'
          fNumber: 4.0000
      focalLength: 0.0039
              OTF: [1×1 struct]
    transmittance: [1×1 struct]
           cos4th: [1×1 struct]

To access the parameters of the optics, you can use oiGet(''), such as

>> oiGet(oi,'optics f number')

ans =

     4

Shift-invariant optics - wavefront aberrations

ISETCam implements shift-invariant optics by specifying wavefront aberrations of the lens at a circular exit pupil. These are represented using the classical Zernike polynomial representation over the disk. There are many online references describing how the Zernike polynomials are used in optics to represent wavefront aberrations. Two important points are that (a) we can calculate the point spread function from the polynomials, and (b) several of the polynomial terms have an impact on the image that can be easily described (e.g., defocus, vertical astigmatism).

ISETCam has a large number of functions to create, set, get, and plot the wavefront representations (wvf).

Wavefront aberrations are particularly helpful when modeling the properties of the human eye, on axis. Many investigators use adaptive optics to measure these aberrations, and we take advantage of these data in the ISETBio toolbox.

Shift-variant optics - ray tracing

When analyzing a real lens, the point spread function varies both with wavelength and visual field position. These variations will be present even when imaging a planar surface. To account for these variations, we use the ray trace lens model.

The 'ray trace' is usually applied when we have a lens description in a lens designer programs, such as Code V or Zemax. We have a Zemax macro that produces a large number of point spread functions as well as the geometric distortion and relative illumination of the lens model. ISETCam (rtImagePSFFieldHeight) imports the output data from the Zemax macro into the ISETCam optics ray trace structure. The oiCompute function uses these parameters for the computation. We have validated that the ISETCam import of the Zemax data produces a rendered image that matches the one calculated using Zemax directly. Recently, we have built a similar macro for Code V.

Clone this wiki locally