Function for fitting a surface with Zernike polynomials
Author: Yiwen Fan (yfan22@ur.rochester.edu)
Institute of Optics, University of Rochester
Usage:
[amn, bmn, z_recon_map] = ZernikeLegendreFit(z_map, M, N, J, K, center_x, center_y)
Description:
This function fits a given surface to Zernike polynomials, supporting up to hundreds of terms. It returns the coefficients of the fit and the reconstructed map.
Inputs:
z_map - The sag table of the surface to be fitted.
M - The highest azimuthal fitting order.
N - The highest radial fitting order.
J - The sampling number in the azimuthal direction, default: 2*M+1
K - The sampling number in the radial direction, default: 2*(N+1)
center_x, center_y - The center of the surface. If not provided, it will be calculated by the FindCenter function.
Outputs:
amn, bmn - The coefficients of the fitted Zernike polynomials.
z_recon_map - The surface map reconstructed from the fitted coefficients.
Acknowledgments:
This work was inspired by the research of Greg Forbes and funded by the National Science Foundation I/UCRC Center for Freeform Optics (IIP-1822026, IIP-1822049).
Part of this work was contributed by Ilhan Kaya in 2010, who wrote the initial jacobiZernike function. This function was later revised by Yiwen Fan and renamed jacobiZernike_table.
引用格式
Yiwen Fan (2024). ZernikeLegendreFit: Fast, precise, high-capacity fitting (https://www.mathworks.com/matlabcentral/fileexchange/132713-zernikelegendrefit-fast-precise-high-capacity-fitting), MATLAB Central File Exchange. 检索来源 .
Fan, Yiwen, et al. “Fast Zernike Fitting of Freeform Surfaces Using the Gauss-Legendre Quadrature.” Optics Express, vol. 32, no. 11, Optica Publishing Group, May 2024, p. 20011, doi:10.1364/oe.523022.
MATLAB 版本兼容性
创建方式
R2023a
兼容任何版本
平台兼容性
Windows macOS Linux标签
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!