Modulation Transfer Function
This map uses Glenn D. Boreman, Modulation Transfer Function in Optical and Electro-Optical Systems, second edition (2021). KrakenOS has three distinct connections to the book: diffraction MTF from a modelled wavefront, slanted-edge MTF from a captured image, and USAF bar-target MTF from selected regions of an image.
Coverage by chapter
Book section |
Match |
KrakenOS implementation |
|---|---|---|
Ch. 1, MTF of optical systems |
Direct/partial |
|
Ch. 2, electro-optical systems |
Related/not modelled |
Pixel pitch converts measured frequency to lp/mm, but detector-footprint, sampling, crosstalk, electronics, noise, and alias correction are not a general cascaded sensor model. |
Ch. 3, PSF/LSF/ESF measurements |
Direct for slanted edge |
|
Ch. 4, square-wave and bar targets |
Direct/partial |
|
Ch. 5, random/noise targets |
Not modelled |
No noise-target MTF estimator was found. |
Ch. 6, measurement and cascade properties |
Partial/related |
CSV/plots and several validators support measurement workflows; there is no general component-MTF cascade or coherence-aware instrument model. |
Ch. 7, environmental MTF |
Partial/related |
Atmospheric modules calculate refraction/seeing-related quantities, but motion, vibration, aerosol, and turbulence MTF are not combined into a Boreman-style cascade. |
Linear systems: Eqs. (1.1), (1.7), and (1.10)–(1.11)
Section 1.2, Eq. (1.1), printed p. 3, writes a shift-invariant image as the object convolved with the impulse response:
Fourier transformation gives Eq. (1.7),
and Sec. 1.3, Eqs. (1.10)–(1.11), separates the optical transfer function:
PSFCalc.calculate_mtf normalizes its sampled PSF, applies a two-dimensional
FFT, takes the absolute value, and normalizes the DC peak. This is a direct
discrete implementation of the MTF part. Because the absolute value is
taken, it does not return the phase transfer function.
Diffraction PSF and MTF: Chapters 1 and 3
PSFCalc.psf4mtf builds a circular complex pupil from fitted wavefront error
\(W\) in waves,
calculate_mtf then applies the preceding OTF equation to that intensity
PSF. GPU-backed array operations use CuPy when available and NumPy otherwise.
The FFT normalization and sampling are implementation choices; spatial
frequency calibration still depends on wavelength, pupil diameter, focal
length, array size, and pupil sampling.
This calculation assumes a monochromatic scalar pupil unless the caller combines wavelengths separately. It is not the MTF of detector integration, sampling, electronics, motion, or atmosphere.
Detector footprint: Eq. (2.2)
Section 2.1, Eq. (2.2), printed p. 41, gives the one-dimensional footprint MTF of a rectangular pixel of width \(w\):
KrakenOS accepts pixel pitch when reporting measured slanted-edge or USAF frequency in line pairs per millimetre, but it does not automatically multiply the modeled optical MTF by this footprint term. Pitch and photosensitive width are also not generally the same. Apply Eq. (2.2) externally only after the actual fill factor and direction are known.
Slanted edge: Eqs. (3.13), (3.15), and (3.16)
Section 3.3, Eq. (3.13), printed p. 71, relates the edge- and line-spread functions:
Equations (3.15)–(3.16), printed p. 72, invert the integral and recover MTF:
EdgeMTF.measure_slanted_edge_mtf implements this chain:
Detect the stronger gradient direction and orient the edge by rows.
Estimate each row’s sub-pixel edge position from the centroid of the absolute intensity derivative.
Fit a straight edge, project every pixel onto its normal, and bin an oversampled ESF.
Difference the ESF, apply a Hann window, take the real FFT magnitude, and normalize at zero frequency.
Return through the native image Nyquist frequency, with optional conversion from cycles/pixel to line pairs/mm using pixel pitch.
This is a practical implementation of Sec. 3.8’s oversampled knife-edge method. It is not a full ISO 12233 conformance implementation: derivative correction, camera nonlinearities, sharpening, edge-angle acceptance, uncertainty, and instrumental MTF corrections require separate control.
USAF bars: Chapter 4
For a 50% duty-cycle square wave, the fundamental modulation is
\(4/\pi\) times the Michelson contrast. USAFMTF.measure_usaf_element
fits DC and the first, third, and fifth harmonics together so that crop leakage
from odd harmonics does not corrupt the fundamental. It then calculates
This directly implements the fundamental square-wave conversion used in the book, while the simultaneous harmonic fit is a robust numerical detail. It is not the complete spectral ratio of every harmonic in an arbitrary bar target. The result is rejected at/above image Nyquist, and optional magnification and pixel pitch provide independent expected/measured image-frequency checks.
MTF cascades: Eqs. (1.8)–(1.9) and Section 6.2
For independent, linear, shift-invariant, incoherent irradiance subsystems, the cascade rule is
KrakenOS has no general API that combines optical OTF, detector footprint, sampling, electronics, motion, vibration, turbulence, and display response. Multiplying MTF magnitudes also loses phase and can be wrong for coherent, nonlinear, aliased, sharpening, or spatially varying stages. Keep the complex OTFs and state the assumptions when building such a cascade externally.
Which KrakenOS result should I use?
Use
PSFCalc.calculate_mtfto predict scalar diffraction MTF from a modeled wavefront.Use
EdgeMTF.measure_slanted_edge_mtffor a dense camera MTF curve from a captured slanted edge.Use
USAFMTF.analyze_usaf_imagefor discrete checks from identified USAF elements and for a human-readable test target.Use geometrical spot analysis only for geometrical blur; do not label it an MTF without an explicit PSF construction and transform.
Important gaps
Detector active-area integration, fill factor, sampling/alias ensemble MTF, crosstalk, electronics, noise-target analysis, motion/vibration MTF, atmospheric MTF cascades, full PTF reporting, ISO 12233 conformance corrections, and measurement uncertainty are not a unified KrakenOS capability.