Clarify normalization of Zernike polynomials

This commit is contained in:
Paul Romano 2018-04-05 12:15:28 -05:00
parent 78b993eda5
commit e0e1dc6bd5
2 changed files with 12 additions and 7 deletions

View file

@ -318,15 +318,15 @@ class ZernikeFilter(ExpansionFilter):
This filter allows scores to be multiplied by Zernike polynomials of the
particle's position normalized to a given unit circle, up to a
user-specified order. The Zernike polynomials are defined as
user-specified order. The Zernike polynomials follow the definition by `Noll
<https://doi.org/10.1364/JOSA.66.000207>`_ and are defined as
.. math::
Z_n^m(\rho, \theta) = R_n^m(\rho) \cos (m\theta)
Z_n^m(\rho, \theta) = \sqrt{2n + 2} R_n^m(\rho) \cos (m\theta), \quad m > 0
and
Z_n^{m}(\rho, \theta) = \sqrt{2n + 2} R_n^{m}(\rho) \sin (m\theta), \quad m < 0
.. math::
Z_n^{-m}(\rho, \theta) = R_n^{-m}(\rho) \sin (m\theta)
Z_n^{m}(\rho, \theta) = \sqrt{n + 1} R_n^{m}(\rho), \quad m = 0
where the radial polynomials are
@ -334,6 +334,9 @@ class ZernikeFilter(ExpansionFilter):
R_n^m(\rho) = \sum\limits_{k=0}^{(n-m)/2} \frac{(-1)^k (n-k)!}{k! (
\frac{n+m}{2} - k)! (\frac{n-m}{2} - k)!} \rho^{n-2k}.
With this definition, the integral of :math:`(Z_n^m)^2` over the unit disk
is exactly :math:`\pi` for each polynomial.
Specifying a filter with order N tallies moments for all :math:`n` from 0 to
N and each value of :math:`m`. The ordering of the Zernike polynomial
moments follows the ANSI Z80.28 standard, where the one-dimensional index

View file

@ -575,8 +575,10 @@ contains
end function calc_rn
!===============================================================================
! CALC_ZN calculates the n-th order Zernike polynomial moment for a given angle
! (rho, theta) location in the unit disk.
! CALC_ZN calculates the n-th order modified Zernike polynomial moment for a
! given angle (rho, theta) location in the unit disk. The normlization of the
! polynomials is such that the integral of Z_pq*Z_pq over the unit disk is
! exactly pi
!===============================================================================
subroutine calc_zn(n, rho, phi, zn)