Computing 3D Zernike Moments on 3D Point Clouds I'm trying to understand the formulation for 3D Zernike descriptors used in A Comparative Study of Object Classification Methods Using 3D Zernike Moment on 3D Point Cloud. For context, I'm looking for a translation invariant method for comparing point cloud representations of molecular surfaces. In researching this, the subject of 3D Zernike moments comes up a lot (for example). I'm having trouble finding a clean algorithm to actually compute these values.
The "3D Zernike Moment on 3D Point Cloud" paper promises a fast computation of these moments, but quite give enough to go on. Here's what the paper says:
\begin{align}
Z_{l,m,n}(X) = \sum_{v=0}^{k} Q_{k,m,n} |X|^{2v}e_{m,n}(X)
\end{align}
\begin{align}
Q_{k,m,n} = \frac{(-1)^{k}}{2^{2k}}  \sqrt{\frac{2m+4k+3}{3}} \binom{2k}{k} (-1)^{v} \frac{\binom{k}{v}\binom{2(k+m+v)+1}{2k}}{\binom{k+m+v}{k}}
\end{align}
Where
\begin{align}
l \in [0, \text{Max}], \quad m\in[0,l], \quad n\in[-m,m], \quad k=\frac{l-m}{2}
\end{align}
The notation of $|X|^{2v}e_{m,n}(X)$ is not defined in the paper.
The paper references this algorithm for computing the moments, but I can't seem to match the notation between papers.
I found aa Python implementation here, but this implementation uses meshes (point clouds with triangular faces) rather than just point clouds, as described in the first paper. This method also requires iterating over all faces, which is very slow. The paper describes computation in milliseconds to seconds.
Is anyone familiar with how to compute these values?
 A: Summary: One definition of $\mathbb{Z}$ is in spherical coordinates, the other in Cartesian coordinates. $\mathbb{R}$ is used for any 3D point in spherical coordinates, and $X$ for any point in Cartesian coordinates.
In https://doi.org/10.1155/2012/353406 formulae 2.1 - 2.9 explicitly define these:
3D Zernike polynomials are defined as
$$\mathbb{Z}_{n, \ell, m}(r, \theta, \phi) = R_{n, l}(r) Y_{\ell, m}(\theta, \phi) \tag{2.1}\label{2.1}$$
Any function $f(r, \theta, \phi)$ defined within the unit ball can be described in terms of the 3D Zernike polynomials via
$$f(r, \theta, \phi) = \sum_{n=0}^{\infty} \sum_{\ell=0}^{n} \sum_{m=-n}^{n} \Omega_{n, \ell, m} \mathbb{Z}_{n, \ell, m} \tag{2.2}\label{2.2}$$
where $\Omega_{n, \ell, m}$ are the 3D Zernike moments, and determined (mathematically) by
$$\Omega_{n, \ell, m} = \int_{0}^{1} d r \int_{0}^{\pi} d \theta \int_{0}^{2 \pi} d \phi ~ \overline{\mathbb{Z}_{n, \ell, m}(r, \theta, \phi)} ~ f(r, \theta, \phi) ~ r^2 \sin \theta \tag{2.3}\label{2.3}$$
where the overline refers to complex conjugation, $\overline{~ a + i b ~} = a - i b$, where $i$ is the imaginary unit, $i = \sqrt{-1}$.
The Cartesian-to-Spherical coordinate system mapping used here is
$$\begin{aligned}
x &= r \sin \theta \sin \phi \\
y &= r \sin \theta \cos \phi \\
z &= r \cos \theta
\end{aligned} \tag{2.4}\label{2.4}$$
In Cartesian coordinates,
$$\mathbb{Z}_{n, \ell, m}(x, y, z) = \sum_{v=0}^{k} Q_{k, \ell, v} ~ \lvert x^2 + y^2 + z^2 \rvert^v ~ e_{\ell, m}(x, y, z) \tag{2.5}\label{2.5}$$
with $k \in \mathbb{N}$ and $k = (n - \ell) / 2$, and where
$$Q_{k, \ell, v} = \frac{(-1)^k}{2^{2 k}} ~ \sqrt{\frac{2\ell + 4 k + 3}{3}} ~ {{2 k} \choose k} ~ (-1)^v ~ \frac{{k \choose v} ~ {{2 ( k + \ell + v ) + 11} \choose {2 k }}}{{k + \ell + v} \choose k} \tag{2.6}\label{2.6}$$
and
$$\begin{aligned}
e_{\ell, m}(x, y, z) ~ = & ~ C_{\ell, m} ~ \sqrt{x^2 + y^2 + z^2}^\ell ~ \left(\frac{i x - y}{2}\right)^m ~ (x + i y)^{\ell - m} ~ \cdot \\
~&~ \sum_{\mu = 0}^{\lfloor (\ell - m) / 2 \rfloor} ~ {\ell \choose \mu} ~ {{ \ell - \mu } \choose { m + \mu }} ~ \left(-\frac{x^2 + y^2}{4 (x + i y)^2}\right)^\mu  \\
\end{aligned}\tag{2.7}\label{2.7}$$
where and the $\cdot$ (multiplication) is a reminder that the expression is a product split on two lines.  In $\eqref{2.7}$,
$$C_{\ell, m} = \frac{\sqrt{(2\ell + 1) ~ (\ell + m)! ~ (\ell - m)!}}{\ell !} \tag{2.8}\label{2.8}$$
(note, factorial ($!$) has precedence over multiplication) so $C_{-\ell, m} = C_{\ell, m}$, and for $\eqref{2.7}$,
$$e_{\ell, -m}(x, y, z) = (-1)^m ~ \overline{e_{\ell, m}(x, y, z)} \tag{2.9}\label{2.9}$$
where the overline again indicating complex conjucation.
As a reminder, $\lfloor ~ \rfloor$ indicate floor (round towards zero) operation, the binomial coefficient is
$${n \choose k} = \frac{n!}{k! ~ (n-k)!}$$
and factorial $n! = 1 \cdot 2 \cdot \ldots \cdot (n-1) \cdot n$.
