主要内容

chromaticAberration

Compute lateral and longitudinal chromatic aberration of optical system

Since R2026a

Description

Add-On Required: This feature requires the Optical Design and Simulation Library for Image Processing Toolbox add-on.

ca = chromaticAberration(opsys) computes the lateral and longitudinal chromatic aberration for the optical system opsys.

example

ca = chromaticAberration(opsys,Name=Value) specifies options for computing chromatic aberration using one or more name-value arguments. For example, NumSamples=200 specifies to compute the chromatic aberration at 200 evenly spaced coordinate points.

Examples

collapse all

Create an optical system that contains a double Gauss lens using the createDoubleGauss helper function. The function is attached to this example as a supporting file.

opsys = createDoubleGauss;

Trace the marginal rays and the chief ray for the optical system.

mrays = traceMarginalRays(opsys);
cray = traceChiefRay(opsys);

Display a 2-D visualization of the optical system and the traced rays. The displayed chief ray is red, and the marginal rays are blue.

hv = view2d(opsys);
addRays(hv,mrays,Color="b")
addRays(hv,cray,Color="r")

Figure contains an object of type optics.ui.opticalsystemviewer2d. The chart of type optics.ui.opticalsystemviewer2d has title 55-mm F/1.2 for 35-mm SLR.

Compute the chromatic aberration of an optical system using the chromaticAberration object function. Specify the maximum field angle as 15 degrees using the MaxFieldAngle name-value argument. Display the results using the show object function.

ca = chromaticAberration(opsys,Wavelengths=[486 586 656],MaxFieldAngle=15);
show(ca)

Figure contains an object of type optics.chart.chromaticaberrationchart. The chart of type optics.chart.chromaticaberrationchart has title Chromatic Aberration.

ans = 
  ChromaticAberrationChart with properties:

    ChromaticAberration: [1×1 optics.result.ChromaticAberration]
                  Color: [3×3 double]
                  Title: "Chromatic Aberration"
                 Legend: on
                   Grid: "off"
                 Parent: [1×1 Figure]

  Show all properties

Input Arguments

collapse all

Optical system for which to compute the chromatic aberration, specified as an opticalSystem object.

Name-Value Arguments

collapse all

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Example: chromaticAberration(NumSamples=200) specifies to compute the chromatic aberration at 200 evenly spaced coordinate points.

Wavelengths for which to trace rays and compute the chromatic aberration, specified as an M-element numeric vector. M is the number of wavelengths, and each element of the vector represents a wavelength, in nanometers. By default, the chromatic aberration is computed at the wavelengths specified by the Wavelengths property of the opticalSystem object opsys.

Index of the reference wavelength at which to compute the chromatic aberration, specified as a positive integer.

If you specify the Wavelengths name-value argument, the default index of the reference wavelength is M/2, rounded up to the nearest integer. M is the number of wavelengths in Wavelengths. If you do not specify the Wavelengths name-value argument, the default reference wavelength is the primary wavelength specified by the PrimaryWavelengthIndex property of the opticalSystem object, opsys.

Maximum field angle, or angle from the optical axis, at which to compute the lens distortion, specified as a numeric scalar in the range [0, 180]. By default, the MaxFieldAngle value is set to 0.9 times the value of the half-angle. To compute the half field of view, or half-angle, use the halfFieldOfView object function.

Decrease the field angle to minimize discontinuities at the possible expense of missing important performance information at larger field angles, such as vignetting.

Number of evenly sampled points at which to compute chromatic aberration, specified as a positive integer. To produce a smoother curve, increase the number of sampled points at the expense of increased computation time.

Output Arguments

collapse all

Lateral and longitudinal chromatic aberration values, returned as a ChromaticAberration object. A plot of the lateral aberration shows how the image points deviate laterally from their ideal positions across the field. A plot of the longitudinal aberration shows how image points deviate along the optical axis.

More About

collapse all

Algorithms

collapse all

Version History

Introduced in R2026a