# Stable Evaluation of 3D Zernike Moments for Surface Meshes
## 7 Conclusions  
We have proposed two new algorithms for the computation of the homogeneous Zernike moments of a solid shape from a triangular mesh representing its boundary. Many algorithms have been proposed for computing such Zernike moments of a shape. Most of these methods usually proceed in two steps, namely computing the geometric moments of the shape first, and then expressing the Zernike moments as linear combinations of those moments. We have showed that this approach works well if the maximum order of the moments is small but fails for large order, due to numerical stability issues associated with computing the Zernike moments from the geometric moments. The new algorithms we propose circumvent this problem by computing directly from the shape. They 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 first algorithm is exact. performing the computation of integrals over the triangles using quadratures of appropriate order. This algorithm, however, is mostly of academic interest due to its limitations. it requires quadrature rules with large strengths. Such rules include large number of sampling points, leading to an overall time complexity \(O(M\times N^{5})\), making it impractical. Quadrature rules, however, are known to converge fast. As such, it is not necessary to go to the maximum strength that is required for an exact computation. The second algorithm implements this idea. We have shown that it is fast, accurate, and allows for computations of moments of very high orders. We have shown also that this program can be easily parallelized, based on the independence of the contribution of each triangle in the boundary mesh. We did note however that as the number of moments that are computed increase, the memory requirement for each thread increases, leading to saturation effects in the parallelization speedup factor. This limitation related to memory would hinder a naive implementation of this algorithm on GPU. We are currently working on solutions to this problem. The free software implementing these algorithms is available at (accessed on 23 September 2022) ([[https://github.com/jerhoud](https://github.com/jerhoud)]([https://github.com/jerhoud](https://github.com/jerhoud))).  
Figure 14: CPU time required to compute the Zernike moments of the gargoyle The speedup in clock time is plotted against the number of CPU or threads used by the parallel version of the approximate algorithm, for different maximum order (50, 100, 150, and 300). The speedup is obtained as an average over 5 independent runs.  
**Author Contributions:** Conceptualization, J.H. and P.K.; methodology, J.H. and P.K.; software, J.H. and P.K.; formal analysis, J.H. and P.K.; investigation, J.H. and P.K.; writing: original draft preparation, J.H. and P.K. All authors have read and agreed to the published version of the manuscript.  
**Funding:** This research received no external funding.  
**Institutional Review Board Statement:** Not applicable.  
**Informed Consent Statement:** Not applicable.  
**Data Availability Statement:** Not applicable.  
**Acknowledgments:** The work discussed here originated from a visit by [PERSON] at the Institut de Physique Theorique, CEA Saclay, France, during the fall of 2018. He thanks them for their hospitality and financial support.  
**Conflicts of Interest:** The authors declare no conflict of interest.