ArticlePublisher preview available

Algorithm for computation of Zernike polynomials expansion coefficients

Optica Publishing Group
Applied Optics
Authors:
To read the full-text of this research, you can request a copy directly from the authors.

Abstract and Figures

A numerically efficient algorithm for expanding a function in a series of Zernike polynomials is presented. The algorithm evaluates the expansion coefficients through the standard 2-D integration formula derived from the Zernike polynomials’ orthogonal properties. Quadratic approximations are used along with the function to be expanded to eliminate the computational problems associated with integrating the oscillatory behavior of the Zernike polynomials. This yields a procedure that is both fast and numerically accurate. Comparisons are made between the proposed scheme and a procedure using a nested 2-D Simpson’s integration rule. The results show that typically at least a fourfold improvement in computational speed can be expected in practical use.
This content is subject to copyright. Terms and conditions apply.
Algorithm for computation of Zernike polynomials
expansion coefficients
Aluizio Prata, Jr., and W. V. T. Rusch
A numerically efficient algorithm for expanding a function in a series of Zernike polynomials is presented.
The algorithm evaluates the expansion coefficients through the standard 2-D integration formula derived
from the Zernike polynomials' orthogonal properties. Quadratic approximations are used along with the
function to be expanded to eliminate the computational problems associated with integrating the oscillatory
behavior of the Zernike polynomials. This yields a procedure that is both fast and numerically accurate.
Comparisons are made between the proposed scheme and a procedure using a nested 2-D Simpson's
integration rule. The results show that typically at least a fourfold improvement in computational speed can
be expected in practical use.
1. Introduction
In the analysis and evaluation of optical systems
with circular pupils it is sometimes convenient to ex-
pand a suitable optical wavefront function in a series of
Zernike polynomials.14 Two schemes for doing this
numerically have been discussed in the literature,
namely, the matrix inversion and the 2-D integration
methods.5 6 Both schemes employ discrete values of
the wavefront function taken at close enough spaced
points over the pupil area so that all the function
relevant features are sampled. In the matrix inversion
method the Zernike expansion is forced to be equal to
the wavefront function at the sampled values; this
generates a linear system of equations that is then
solved for the expansion coefficients. In the integra-
tion method each expansion coefficient is computed by
integrating the wavefront function times the corre-
sponding Zernike polynomial over the pupil area.
Both methods have their own virtues and shortcom-
ings. In particular, they are usually computationally
inefficient since the first has to solve a linear system of
equations and the second has to integrate over the
highly oscillatory Zernike polynomials. This work
deals only with the integration method, for which a
numerical algorithm that is both computationally effi-
cient and accurate is developed.
The authors are with University of Southern California,
Depart-
ment of Electrical Engineering, Los Angeles, California 90089.
Received 27 June 1988.
0003-6935/89/040749-06$02.00/0.
© 1989 Optical Society of America.
The algorithm presented below works by using sec-
ond-degree polynomial approximations in association
with the function to be expanded; the expansion coeffi-
cient integrals can then be evaluated analytically, and
the problems caused by the oscillatory behavior of the
Zernike polynomials are eliminated. The algorithm so
obtained has the important characteristic that the
number of function evaluations required to compute
the expansion coefficients are determined solely by the
number of samples required to characterize the func-
tion behavior, being independent of the order of the
expansion term being computed. This is the property
responsible for its accuracy and speed.
11. Zernike Polynomials
Since the Zernike polynomials have been extensive-
ly discussed in the literature, a complete presentation
of their characteristics is not necessary. Then, instead
of repeating results available elsewhere, in what fol-
lows we concentrate only on the few specific properties
relevant to this work.
Several slightly different Zernike polynomial nor-
malizations have been used in the literature. Without
loss in generality, here only the original normalization
(and corresponding definition) of the Zernike polyno-
mials will be adopted.14 According to it the odd and
even Zernike polynomials are given by
0UT(p,) sin
= R'7(p) mk),
e~rn(P,cp) 11 Cos (1)
respectively, with the radial functions R'(p) defined as
(n-m)/2 (n - ) ! n 21
RI7(p) = (-1)1- (nP- 2)
1![(n + m)12
-l]![(n -m)/2 -]!pf 2()
15 February 1989 / Vol. 28, No. 4/ APPLIED OPTICS 749
... However, the stopping condition is unknown at that time and the formula is singular when k 1 = 0. In 1989, Prata and Rusch [15] proposed the following recursive scheme R m n (ρ) = ρL 1 R m−1 n−1 (ρ) + L 2 R m n−2 (ρ), n ≥ 2 (8) with the coefficients ...
... This m-recursive scheme is more efficient than the other recursive schemes for computing R m n (ρ). However, ρ = 0 is a singular point in (15) although R m n (ρ) is regular for all ρ ∈ [0, 1]. Thus the computation will be unstable if ρ is small enough. ...
... However, for the R m n (ρ) with two integers n and m as arguments, there is a lack of feasible method to convert the recursive formula to iterative versions. Although Kintner's n-recursive formula (6) can be reformulated as an iterative formula, it is limited for n ≥ 4; Chong's m-recursive scheme (15) can be converted to its iterative version, however the singular point ρ = 0 will still exist. For the coupled recursive formulae (8) (or (12) equivalently) and (13), their iterative implementations are still to be explored. ...
Article
Full-text available
Zernike radial polynomials play a significant role in application areas such as optics design, imaging systems, and image processing systems. Currently, there are two kinds of numerical schemes for computing the Zernike radial polynomials automatically with computer programs: one is based on the definition in which the factorial operations may lead to the overflow problem and the high order derivatives are troublesome, and the other is based on recursion which is either unstable or with high computational complexity. In this paper, our emphasis is focused on exploring the balanced binary tree (BBT) schemes for computing Zernike radial polynomials: firstly we establish an elegant formulae for computation; secondly we propose the recursive and iterative algorithms based-on BBT; thirdly we analyze the computational complexity of the algorithms rigorously; finally we verify and validate the performance of BBT schemes by testing the running time. Theoretical analysis shows that the computational complexity of BBT recursive algorithm and iterative algorithm are exponential and quadratic respectively, which coincides with the running time test very well. Experiments show that the time consumption is about 1 ~ 10 microseconds with different computation platforms for the BBT iterative algorithm (BBTIA), which is stable and efficient for real-time applications.
... However, the stopping condition is unknown at that time and the formulae is singular when k 1 = 0. In 1989, Prata and Rusch [14] proposed the following recursive scheme R m n (ρ) = ρL 1 R m−1 n−1 (ρ) + L 2 R m n−2 (ρ), n ≥ 2; (6) with the coefficients ...
... Our novel recursive formulae is a combination of the recursive schemes in [5] and [14]. The trick of the exploring is to reduce the difference of the up-down scripts appearing the right hand side in (10) and (11) with a common constant so as to get a balanced result, see Table 1. ...
Preprint
Full-text available
Zernike radial polynomials play a significant role in application areas such as optics design, imaging systems, and image processing systems. Currently, there are two kinds of numerical schemes for computing the Zernike radial polynomials automatically with computer programs: one is based on the definition in which the factorial operations may lead to the overflow problem and the high order derivatives are troublesome, and the other is based on recursion which is either unstable or with high computational complexity. In this paper, our emphasis is focused on exploring the \textit{balanced binary tree} (BBT) schemes for computing Zernike radial polynomials: firstly we established an elegant formulae for computation; secondly we proposed the recursive and iterative algorithms based-on BBT; thirdly we analyzed the computational complexity of the algorithms rigorously; finally we verified and validated the performance of BBT schemes by testing the running time. Theoretic analysis shows that the computational complexity of BBT recursive algorithm and iterative algorithm are exponential and quadratic respectively, which coincides with the running time test very well. Experiments show that the time consumption is about 1101\sim 10 microseconds with different computation platforms for the BBT iterative algorithm (BBTIA), which is stable and efficient for realtime applications.
... To deal with these problems, various recurrence relations have been proposed for evaluating the radial polynomials [60][61][62][63][64]. Here we briefly review four widely-used recurrence methods, including the modified Kintner method [59,65], the Prata's method [66], the q-recursive method [59], and the Shakibaei and Paramesran method [62]. The modified Kintner method was first proposed by Kintner in 1976 [65] and improved by Chong et al. in 2003 [59] by adding recurrence relations for special cases when n − m = 0 and 2. The improved recurrence relation can be expressed as ...
... The modified Kintner method is a degree-varying (n-varying) approach that computes radial polynomials at higher order from those at lower order for a fixed value of m. The Prata method was proposed by Prata and Rusch in 1989 [66] and the recurrence relation can be written as ...
Article
Full-text available
The Zernike polynomials are a complete set of continuous functions orthogonal over a unit circle. Since first developed by Zernike in 1934, they have been in widespread use in many fields ranging from optics, vision sciences, to image processing. However, due to the lack of a unified definition, many confusing indices have been used in the past decades and mathematical properties are scattered in the literature. This review provides a comprehensive account of Zernike circle polynomials and their noncircular derivatives, including history, definitions, mathematical properties, roles in wavefront fitting, relationships with optical aberrations, and connections with other polynomials. We also survey state-of-the-art applications of Zernike polynomials in a range of fields, including the diffraction theory of aberrations, optical design, optical testing, ophthalmic optics, adaptive optics, and image analysis. Owing to their elegant and rigorous mathematical properties, the range of scientific and industrial applications of Zernike polynomials is likely to expand. This review is expected to clear up the confusion of different indices, provide a self-contained reference guide for beginners as well as specialists, and facilitate further developments and applications of the Zernike polynomials.
... Despite their straightforward nature, these techniques were often computationally expensive and prone to numerical instability. Over time, more sophisticated methods have emerged, such as the use of recurrence relations [15,16,17,18,19,20,21]. These studies successfully addressed instability issues for higher mode numbers and provided fast algorithms for calculating Zernike polynomials. ...
Preprint
Full-text available
Zernike Polynomials serve as an orthogonal basis on the unit disc, and have been proven to be effective in optics simulations, astrophysics, and more recently in plasma simulations. Unlike Bessel functions, they maintain finite values at the disc center, ensuring inherent analyticity along the axis. We developed ZERNIPAX, an open-source Python package capable of utilizing CPU/GPUs, leveraging Google's JAX package and available on https://github.com/PlasmaControl/FastZernike.git as well as PyPI. Our implementation of the recursion relation between Jacobi polynomials significantly improves computation time compared to alternative methods by use of parallel computing while still preserving accuracy for mode numbers n>100.
... Prata and Rusch have derived relationships for similar integrals for the 2D Zernike radial polynomials [58]. We expand their results here. ...
Article
Full-text available
The 3D Zernike polynomials form an orthonormal basis of the unit ball. The associated 3D Zernike moments have been successfully applied for 3D shape recognition; they are popular in structural biology for comparing protein structures and properties. Many algorithms have been proposed for computing those moments, starting from a voxel-based representation or from a surface based geometric mesh of the shape. As the order of the 3D Zernike moments increases, however, those algorithms suffer from decrease in computational efficiency and more importantly from numerical accuracy. In this paper, new algorithms are proposed to compute the 3D Zernike moments of a homogeneous shape defined by an unstructured triangulation of its surface that remove those numerical inaccuracies. These algorithms rely on the analytical integration of the moments on tetrahedra defined by the surface triangles and a central point and on a set of novel recurrent relationships between the corresponding integrals. The mathematical basis and implementation details of the algorithms are presented and their numerical stability is evaluated.
Article
Image representation is an important topic in computer vision and pattern recognition. It plays a fundamental role in a range of applications toward understanding visual contents. Moment-based image representation has been reported to be effective in satisfying the core conditions of semantic description due to its beneficial mathematical properties, especially geometric invariance and independence. This article presents a comprehensive survey of the orthogonal moments for image representation, covering recent advances in fast/accurate calculation, robustness/invariance optimization, definition extension, and application. We also create a software package for a variety of widely used orthogonal moments and evaluate such methods in a same base. The presented theory analysis, software implementation, and evaluation results can support the community, particularly in developing novel techniques and promoting real-world applications.
Article
As one of the most widely used orthogonal moments, Zernike moments (ZMs) have been applied in various fields. But low-order ZMs encounter problem for describing small size images. The cause of this problem lies in that zeros of ZMs' radial basis function (RBF) bias toward large radial distance from the origin. Fractional Zernike moments (FrZMs) can be utilized to deal with small size images by adjusting RBF's zeros distribution with fractional-order parameter. But high-order FrZMs will result in numerical instability. To address these problems, ZMs are generalized to transformed Zernike moments (TZMs) and logarithmic Zernike moments (LoZMs) are proposed. ZMs and FrZMs are only special cases of TZMs. LoZMs are constructed by a particularly designed transformed function such that zeros of LoZMs'RBF are near evenly distributed in interval [0,1]. As a result, small size images can be well represented with low-order LoZMs. Furthermore, amplitudes of LoZMs'RBF keep relatively stable and numerical instability of high-order moments is suppressed. Extensive experiments are conducted to demonstrate the superior performance of LoZMs in image reconstruction and pattern recognition tasks. In addition, a quaternion-based zero-watermarking algorithm also shows that LoZMs perform better than ZMs.
Article
Full-text available
This paper discusses some general properties of Zernike polynomials, such as their Fourier transforms, integral representations, and derivatives. A Zernike representation of the Kolmogoroff spectrum of turbulence is given that provides a complete analytical description of the number of independent corrections required in a wave-front compensation system.
Article
Full-text available
Several low-order Zernike modes are photographed for visualization. These polynomials are extended to include both circular and annular pupils through a Gram-Schmidt orthogonalization procedure. Contrary to the traditional understanding, the classical least-squares method of determining the Zernike coefficients from a sampled wave front with measurement noise has been found numerically stable. Furthermore, numerical analysis indicates that the so-called Gram-Schmidt method and the least-squares method give practically identical results. An alternate method using the orthogonal property of the polynomials to determine their coefficients is also discussed.
Article
Solution to the problem of determining the constant coefficients A//n//m of the wave aberration is presented.
Article
The principal areas of application of Zernike polynomials in optics are discussed. Their advantages in the solving of many problems of theoretical optics are indicated. The critical literature survey devoted to this problem is included.
Article
The paper is concerned with the construction of polynomials in two variables, which form a complete orthogonal set for the interior of the unit circle and which are ‘invariant in form’ with respect to rotations of axes about the origin of coordinates. It is found that though there exist an infinity of such sets there is only one set which in addition has certain simple properties strictly analogous to that of Legendre polynomials. This set is found to be identical with the set of the circle polynomials of Zernike which play an important part in the theory of phase contrast and in the Nijboer-Zernike diffraction theory of optical aberrations. The results make it possible to derive explicit expressions for the Zernike polynomials in a simple, systematic manner. The method employed may also be used to derive other orthogonal sets. One new set is investigated, and the generating functions for this set and for the Zernike polynomials are also given.
On a Quadrature Formula for Trigonometric Integrals
  • L. N. G. Filon
L. N. G. Filon, "On a Quadrature Formula for Trigonometric Integrals," Proc. R. Soc. Edinburgh 49, 38 (1928-1929).
Methods of Numerical Integra-tion 2nd. edition (Academic
  • P F Davis
  • R Rabinowitz
P. F. Davis and R. Rabinowitz, Methods of Numerical Integra-tion 2nd. edition (Academic, New York, 1984), Sec. 2.10. E. Patzak of the Heinrich Hertz Institute, photographed by W. J.
The Use of Zernike Polynomials in Optics
  • S N Bezdidko
S. N. Bezdidko, "The Use of Zernike Polynomials in Optics," Sov. J. Opt. Technol. 41, 425 (1974).
Determination of the Zernike Polynomial Expansion Coefficients of the Wave Aberration
  • S N Bezdidko
S. N. Bezdidko, "Determination of the Zernike Polynomial Expansion Coefficients of the Wave Aberration," Sov. J. Opt. Technol. 42, 426 (1975).