Zernike polynomials

(Redirected from Zernike polynomial)
The first 21 Zernike polynomials, ordered vertically by radial degree and horizontally by azimuthal degree

In mathematics, the Zernike polynomials are a sequence of polynomials that are orthogonal on the unit disk. Named after optical physicist Frits Zernike, winner of the 1953 Nobel Prize in Physics and the inventor of phase-contrast microscopy, they play an important role in beam optics.[1][2]

Definitions

There are even and odd Zernike polynomials. The even ones are defined as

${\displaystyle Z_{n}^{m}(\rho ,\varphi )=R_{n}^{m}(\rho )\,\cos(m\,\varphi )\!}$

and the odd ones as

${\displaystyle Z_{n}^{-m}(\rho ,\varphi )=R_{n}^{m}(\rho )\,\sin(m\,\varphi ),\!}$

where m and n are nonnegative integers with n ≥ m, φ is the azimuthal angle, ρ is the radial distance ${\displaystyle 0\leq \rho \leq 1}$, and Rmn are the radial polynomials defined below. Zernike polynomials have the property of being limited to a range of −1 to +1, i.e. ${\displaystyle |Z_{n}^{m}(\rho ,\varphi )|\leq 1}$. The radial polynomials Rmn are defined as

${\displaystyle R_{n}^{m}(\rho )=\sum _{k=0}^{\tfrac {n-m}{2}}{\frac {(-1)^{k}\,(n-k)!}{k!\left({\tfrac {n+m}{2}}-k\right)!\left({\tfrac {n-m}{2}}-k\right)!}}\;\rho ^{n-2\,k}}$

for nm even, and are identically 0 for nm odd.

Other representations

Rewriting the ratios of factorials in the radial part as products of binomials shows that the coefficients are integer numbers:

${\displaystyle R_{n}^{m}(\rho )=\sum _{k=0}^{\tfrac {n-m}{2}}(-1)^{k}{\binom {n-k}{k}}{\binom {n-2k}{{\tfrac {n-m}{2}}-k}}\rho ^{n-2k}}$.

A notation as terminating Gaussian hypergeometric functions is useful to reveal recurrences, to demonstrate that they are special cases of Jacobi polynomials, to write down the differential equations, etc.:

{\displaystyle {\begin{aligned}R_{n}^{m}(\rho )&={\binom {n}{\tfrac {n+m}{2}}}\rho ^{n}\ {}_{2}F_{1}\left(-{\tfrac {n+m}{2}},-{\tfrac {n-m}{2}};-n;\rho ^{-2}\right)\\&=(-1)^{\tfrac {n-m}{2}}{\binom {\tfrac {n+m}{2}}{m}}\rho ^{m}\ {}_{2}F_{1}\left(1+{\tfrac {n+m}{2}},-{\tfrac {n-m}{2}};1+m;\rho ^{2}\right)\end{aligned}}}

for nm even.

Noll's sequential indices

Applications often involve linear algebra, where integrals over products of Zernike polynomials and some other factor build the matrix elements. To enumerate the rows and columns of these matrices by a single index, a conventional mapping of the two indices n and m to a single index j has been introduced by Noll.[3] The table of this association ${\displaystyle Z_{n}^{m}\rightarrow Z_{j}}$ starts as follows (sequence A176988 in the OEIS)

 n,m j n,m j 0,0 1,1 1,−1 2,0 2,−2 2,2 3,−1 3,1 3,−3 3,3 1 2 3 4 5 6 7 8 9 10 4,0 4,2 4,−2 4,4 4,−4 5,1 5,−1 5,3 5,−3 5,5 11 12 13 14 15 16 17 18 19 20

The rule is that the even Z (with even azimuthal part m, ${\displaystyle \cos(m\varphi )}$) obtain even indices j, the odd Z odd indices j. Within a given n, lower values of m obtain lower j.

OSA/ANSI standard indices

OSA [4] and ANSI single-index Zernike polynomials using:

${\displaystyle j={\frac {n(n+2)+m}{2}}}$
 n,m j n,m j 0,0 1,-1 1,1 2,-2 2,0 2,2 3,-3 3,-1 3,1 3,3 0 1 2 3 4 5 6 7 8 9 4,-4 4,-2 4,0 4,2 4,4 5,-5 5,−1 5,-3 5,−1 5,1 10 11 12 13 14 15 16 17 18 19

Properties

Orthogonality

${\displaystyle \int _{0}^{1}\rho {\sqrt {2n+2}}R_{n}^{m}(\rho )\,{\sqrt {2n'+2}}R_{n'}^{m}(\rho )\,d\rho =\delta _{n,n'}.}$

Orthogonality in the angular part is represented by[citation needed]

${\displaystyle \int _{0}^{2\pi }\cos(m\varphi )\cos(m'\varphi )\,d\varphi =\epsilon _{m}\pi \delta _{|m|,|m'|},}$
${\displaystyle \int _{0}^{2\pi }\sin(m\varphi )\sin(m'\varphi )\,d\varphi =(-1)^{m+m'}\pi \delta _{|m|,|m'|};\quad m\neq 0,}$
${\displaystyle \int _{0}^{2\pi }\cos(m\varphi )\sin(m'\varphi )\,d\varphi =0,}$

where ${\displaystyle \epsilon _{m}}$ (sometimes called the Neumann factor because it frequently appears in conjunction with Bessel functions) is defined as 2 if ${\displaystyle m=0}$ and 1 if ${\displaystyle m\neq 0}$. The product of the angular and radial parts establishes the orthogonality of the Zernike functions with respect to both indices if integrated over the unit disk,

${\displaystyle \int Z_{n}^{m}(\rho ,\varphi )Z_{n'}^{m'}(\rho ,\varphi )\,d^{2}r={\frac {\epsilon _{m}\pi }{2n+2}}\delta _{n,n'}\delta _{m,m'},}$

where ${\displaystyle d^{2}r=\rho \,d\rho \,d\varphi }$ is the Jacobian of the circular coordinate system, and where ${\displaystyle n-m}$ and ${\displaystyle n'-m'}$ are both even.

A special value is

${\displaystyle R_{n}^{m}(1)=1,\,}$

Zernike transform

Any sufficiently smooth real-valued phase field over the unit disk ${\displaystyle G(\rho ,\varphi )}$ can be represented in terms of its Zernike coefficients (odd and even), just as periodic functions find an orthogonal representation with the Fourier series. We have

${\displaystyle G(\rho ,\varphi )=\sum _{m,n}\left[a_{m,n}Z_{n}^{m}(\rho ,\varphi )+b_{m,n}Z_{n}^{-m}(\rho ,\varphi )\right],}$

where the coefficients can be calculated using inner products. On the space of ${\displaystyle L^{2}}$ functions on the unit disk, there is an inner product defined by

${\displaystyle \langle F,G\rangle :=\int F(\rho ,\varphi )G(\rho ,\varphi )\rho d\rho d\varphi .}$

The Zernike coefficients can then be expressed as follows:

{\displaystyle {\begin{aligned}a_{m,n}&={\frac {2n+2}{\epsilon _{m}\pi }}\left\langle G(\rho ,\varphi ),Z_{n}^{m}(\rho ,\varphi )\right\rangle ,\\b_{m,n}&={\frac {2n+2}{\epsilon _{m}\pi }}\left\langle G(\rho ,\varphi ),Z_{n}^{-m}(\rho ,\varphi )\right\rangle .\end{aligned}}}

Alternatively, one can use the known values of phase function G on the circular grid to form a system of equations. The phase function is retrieved by the unknown-coefficient weighted product with (known values) of Zernike polynomial across the unit grid. Hence, coefficients can also be found by solving a linear system, for instance by matrix inversion. Fast algorithms to calculate the forward and inverse Zernike transform use symmetry properties of trigonometric functions, separability of radial and azimuthal parts of Zernike polynomials, and their rotational symmetries.

Symmetries

The parity with respect to reflection along the x axis is

${\displaystyle Z_{n}^{m}(\rho ,\varphi )=(-1)^{m}Z_{n}^{m}(\rho ,-\varphi ).}$

The parity with respect to point reflection at the center of coordinates is

${\displaystyle Z_{n}^{m}(\rho ,\varphi )=(-1)^{m}Z_{n}^{m}(\rho ,\varphi +\pi ),}$

where ${\displaystyle (-1)^{m}}$ could as well be written ${\displaystyle (-1)^{n}}$ because ${\displaystyle n-m}$ is even for the relevant, non-vanishing values. The radial polynomials are also either even or odd, depending on order n or m:

${\displaystyle R_{n}^{m}(\rho )=(-1)^{n}R_{n}^{m}(-\rho )=(-1)^{m}R_{n}^{m}(-\rho ).}$

The periodicity of the trigonometric functions implies invariance if rotated by multiples of ${\displaystyle 2\pi /m}$ radian around the center:

${\displaystyle Z_{n}^{m}\left(\rho ,\varphi +{\tfrac {2\pi k}{m}}\right)=Z_{n}^{m}(\rho ,\varphi ),\qquad k=0,\pm 1,\pm 2,\cdots .}$

Recurrence relations

The Zernike polynomials satisfy the following recurrence relation which depends neither on the degree nor on the azimuthal order of the radial polynomials:[5]

{\displaystyle {\begin{aligned}R_{n}^{m}(\rho )+R_{n-2}^{m}(\rho )=\rho \left[R_{n-1}^{\left|m-1\right|}(\rho )+R_{n-1}^{m+1}(\rho )\right]{\text{ .}}\end{aligned}}}

From the definition of ${\displaystyle R_{n}^{m}}$ it can be seen that ${\displaystyle R_{m}^{m}(\rho )=\rho ^{m}}$ and ${\displaystyle R_{m+2}^{m}(\rho )=((m+2)\rho ^{2}-(m+1))\rho ^{m}}$. The following three-term recurrence relation[6] then allows to calculate all other ${\displaystyle R_{n}^{m}(\rho )}$:

${\displaystyle R_{n}^{m}(\rho )={\frac {2(n-1)(2n(n-2)\rho ^{2}-m^{2}-n(n-2))R_{n-2}^{m}(\rho )-n(n+m-2)(n-m-2)R_{n-4}^{m}(\rho )}{(n+m)(n-m)(n-2)}}{\text{ .}}}$

The above relation is especially useful since the derivative of ${\displaystyle R_{n}^{m}}$ can be calculated from two radial Zernike polynomials of adjacent degree:[6]

${\displaystyle {\frac {\operatorname {d} }{\operatorname {d} \!\rho }}R_{n}^{m}(\rho )={\frac {(2nm(\rho ^{2}-1)+(n-m)(m+n(2\rho ^{2}-1)))R_{n}^{m}(\rho )-(n+m)(n-m)R_{n-2}^{m}(\rho )}{2n\rho (\rho ^{2}-1)}}{\text{ .}}}$

Examples

The first few radial polynomials are:

${\displaystyle R_{0}^{0}(\rho )=1\,}$
${\displaystyle R_{1}^{1}(\rho )=\rho \,}$
${\displaystyle R_{2}^{0}(\rho )=2\rho ^{2}-1\,}$
${\displaystyle R_{2}^{2}(\rho )=\rho ^{2}\,}$
${\displaystyle R_{3}^{1}(\rho )=3\rho ^{3}-2\rho \,}$
${\displaystyle R_{3}^{3}(\rho )=\rho ^{3}\,}$
${\displaystyle R_{4}^{0}(\rho )=6\rho ^{4}-6\rho ^{2}+1\,}$
${\displaystyle R_{4}^{2}(\rho )=4\rho ^{4}-3\rho ^{2}\,}$
${\displaystyle R_{4}^{4}(\rho )=\rho ^{4}\,}$
${\displaystyle R_{5}^{1}(\rho )=10\rho ^{5}-12\rho ^{3}+3\rho \,}$
${\displaystyle R_{5}^{3}(\rho )=5\rho ^{5}-4\rho ^{3}\,}$
${\displaystyle R_{5}^{5}(\rho )=\rho ^{5}\,}$
${\displaystyle R_{6}^{0}(\rho )=20\rho ^{6}-30\rho ^{4}+12\rho ^{2}-1\,}$
${\displaystyle R_{6}^{2}(\rho )=15\rho ^{6}-20\rho ^{4}+6\rho ^{2}\,}$
${\displaystyle R_{6}^{4}(\rho )=6\rho ^{6}-5\rho ^{4}\,}$
${\displaystyle R_{6}^{6}(\rho )=\rho ^{6}.\,}$

Zernike polynomials

The first few Zernike modes, with OSA/ANSI and Noll single-indices, are shown below. They are normalized such that

${\displaystyle \int _{0}^{2\pi }\int _{0}^{1}Z_{j}^{2}\,\rho \,d\rho \,d\theta =\pi .}$
OSA/ANSI
index (${\displaystyle j}$)
Noll
index (${\displaystyle j}$)
degree (${\displaystyle n}$)
Azimuthal
degree (${\displaystyle m}$)
${\displaystyle Z_{j}}$ Classical name
${\displaystyle Z_{0}^{0}}$ 0 1 0 0 ${\displaystyle 1}$ Piston (see, Wigner semicircle distribution)
${\displaystyle Z_{1}^{-1}}$ 1 3 1 −1 ${\displaystyle 2\rho \sin \theta }$ Tilt (Y-Tilt, vertical tilt)
${\displaystyle Z_{1}^{1}}$ 2 2 1 1 ${\displaystyle 2\rho \cos \theta }$ Tip (X-Tilt, horizontal tilt)
${\displaystyle Z_{2}^{-2}}$ 3 5 2 −2 ${\displaystyle {\sqrt {6}}\rho ^{2}\sin 2\theta }$ Oblique astigmatism
${\displaystyle Z_{2}^{0}}$ 4 4 2 0 ${\displaystyle {\sqrt {3}}(2\rho ^{2}-1)}$ Defocus (longitudinal position)
${\displaystyle Z_{2}^{2}}$ 5 6 2 2 ${\displaystyle {\sqrt {6}}\rho ^{2}\cos 2\theta }$ Vertical astigmatism
${\displaystyle Z_{3}^{-3}}$ 6 9 3 −3 ${\displaystyle {\sqrt {8}}\rho ^{3}\sin 3\theta }$ Vertical trefoil
${\displaystyle Z_{3}^{-1}}$ 7 7 3 −1 ${\displaystyle {\sqrt {8}}(3\rho ^{3}-2\rho )\sin \theta }$ Vertical coma
${\displaystyle Z_{3}^{1}}$ 8 8 3 1 ${\displaystyle {\sqrt {8}}(3\rho ^{3}-2\rho )\cos \theta }$ Horizontal coma
${\displaystyle Z_{3}^{3}}$ 9 10 3 3 ${\displaystyle {\sqrt {8}}\rho ^{3}\cos 3\theta }$ Oblique trefoil
${\displaystyle Z_{4}^{-4}}$ 10 15 4 −4 ${\displaystyle {\sqrt {10}}\rho ^{4}\sin 4\theta }$ Oblique quadrafoil
${\displaystyle Z_{4}^{-2}}$ 11 13 4 −2 ${\displaystyle {\sqrt {10}}(4\rho ^{4}-3\rho ^{2})\sin 2\theta }$ Oblique secondary astigmatism
${\displaystyle Z_{4}^{0}}$ 12 11 4 0 ${\displaystyle {\sqrt {5}}(6\rho ^{4}-6\rho ^{2}+1)}$ Primary spherical
${\displaystyle Z_{4}^{2}}$ 13 12 4 2 ${\displaystyle {\sqrt {10}}(4\rho ^{4}-3\rho ^{2})\cos 2\theta }$ Vertical secondary astigmatism
${\displaystyle Z_{4}^{4}}$ 14 14 4 4 ${\displaystyle {\sqrt {10}}\rho ^{4}\cos 4\theta }$ Vertical quadrafoil

Applications

The functions are a basis defined over the circular support area, typically the pupil planes in classical optical imaging at visible and infrared wavelengths through systems of lenses and mirrors of finite diameter. Their advantages are the simple analytical properties inherited from the simplicity of the radial functions and the factorization in radial and azimuthal functions; this leads, for example, to closed-form expressions of the two-dimensional Fourier transform in terms of Bessel functions. Their disadvantage, in particular if high n are involved, is the unequal distribution of nodal lines over the unit disk, which introduces ringing effects near the perimeter ${\displaystyle \rho \approx 1}$, which often leads attempts to define other orthogonal functions over the circular disk. The first modal aberration (piston) is also known as the Wigner semicircle distribution.

In precision optical manufacturing, Zernike polynomials are used to characterize higher-order errors observed in interferometric analyses, in order to achieve desired system performance.

In optometry and ophthalmology, Zernike polynomials are used to describe aberrations of the cornea or lens from an ideal spherical shape, which result in refraction errors.

They are commonly used in adaptive optics, where they can be used to effectively cancel out atmospheric distortion. Obvious applications for this are IR or visual astronomy and satellite imagery. For example, one of the Zernike terms (for m = 0, n = 2) is called "de-focus". By coupling the output from this term to a control system, an automatic focus can be implemented.

Another application of the Zernike polynomials is found in the Extended Nijboer–Zernike (ENZ) theory of diffraction and aberrations.

Zernike polynomials are widely used as basis functions of image moments. Since Zernike polynomials are orthogonal to each other, Zernike moments can represent properties of an image with no redundancy or overlap of information between the moments. Although Zernike moments are significantly dependent on the scaling and the translation of the object in a region of interest (ROI), their magnitudes are independent of the rotation angle of the object.[7] Thus, they can be utilized to extract features from images that describe the shape characteristics of an object. For instance, Zernike moments are utilized as shape descriptors to classify benign and malignant breast masses.[8][9] Zernike Moments also have been used to quantify shape of osteosarcoma cancer cell lines in single cell level. These quantifiers of cell shape have been used to distinguish between high invasive cancer cell lines from low invasive lines.[10]

Higher dimensions

The concept translates to higher dimensions D if multinomials ${\displaystyle x_{1}^{i}x_{2}^{j}\cdots x_{D}^{k}}$ in Cartesian coordinates are converted to hyperspherical coordinates, ${\displaystyle \rho ^{s},s\leq D}$, multiplied by a product of Jacobi polynomials of the angular variables. In ${\displaystyle D=3}$ dimensions, the angular variables are spherical harmonics, for example. Linear combinations of the powers ${\displaystyle \rho ^{s}}$ define an orthogonal basis ${\displaystyle R_{n}^{(l)}(\rho )}$ satisfying

${\displaystyle \int _{0}^{1}\rho ^{D-1}R_{n}^{(l)}(\rho )R_{n'}^{(l)}(\rho )d\rho =\delta _{n,n'}}$.

(Note that a factor ${\displaystyle {\sqrt {2n+D}}}$ is absorbed in the definition of R here, whereas in ${\displaystyle D=2}$ the normalization is chosen slightly differently. This is largely a matter of taste, depending on whether one wishes to maintain an integer set of coefficients or prefers tighter formulas if the orthogonalization is involved.) The explicit representation is

{\displaystyle {\begin{aligned}R_{n}^{(l)}(\rho )&={\sqrt {2n+D}}\sum _{s=0}^{\tfrac {n-l}{2}}(-1)^{s}{{\tfrac {n-l}{2}} \choose s}{n-s-1+{\tfrac {D}{2}} \choose {\tfrac {n-l}{2}}}\rho ^{n-2s}\\&=(-1)^{\tfrac {n-l}{2}}{\sqrt {2n+D}}\sum _{s=0}^{\tfrac {n-l}{2}}(-1)^{s}{{\tfrac {n-l}{2}} \choose s}{s-1+{\tfrac {n+l+D}{2}} \choose {\tfrac {n-l}{2}}}\rho ^{2s+l}\\&=(-1)^{\tfrac {n-l}{2}}{\sqrt {2n+D}}{{\tfrac {n+l+D}{2}}-1 \choose {\tfrac {n-l}{2}}}\rho ^{l}\ {}_{2}F_{1}\left(-{\tfrac {n-l}{2}},{\tfrac {n+l+D}{2}};l+{\tfrac {D}{2}};\rho ^{2}\right)\end{aligned}}}

for even ${\displaystyle n-l\geq 0}$, else identical to zero.