Problem 1000. Image Processing 004: Zernike Coefficients
Fit Zernike Terms to a wavefront.
The class notes of Schwiegerling UofA on ANSI Standard Zernike terms is the basis for this challenge. Pages 13 and 14 give the term definitions implemented in the zern_data_v01.m routine provided in the function template.
ANSI Standard Zernike Chart:
Algorithm Description:
M=surface array to be fit by Zernike terms;
-valid data is circle of normalized radius<=1
Use the R and T arrays to create the A array
R=radial normalized distance from center of array
T=angular radian value from center of array
A=fitting array [valid_data_pts,terms]
Create A * z_fit = M(valid_data_pts)
[valid_pts,terms] * [terms,1] = [valid_pts,1]
Loop term=0:terms-1
- Create the 2-D array of z-terms uisng z=zern_data_v01(term,R,T)
- A(:,term+1) = z(valid_data_pts)
End Loop
Solve for z_fit: pinv(A)*M(valid_pts) or A\M(valid_pts)
Inputs: [M N R T] where N is number of Zernike terms for fit
Outputs: [v] Zernike fit vector of length N
Creation of the M surface and expected v fit vector can be seen in the Test Suite.
Solution Stats
Problem Comments
-
3 Comments
Rafael S.T. Vieira
on 12 Sep 2020
Could you please fix the function urlwrite? Or remove it...adding the code for the function zern_data_v01(j,r,t) at the end of the live script. Good problem.
Richard Zapor
on 29 Sep 2020
Link fixed 9/29/20202.
All submissions being re-evaluated
Rafael S.T. Vieira
on 1 Oct 2020
Thanks, Richard.
Solution Comments
Show commentsProblem Recent Solvers3
Suggested Problems
-
Renaming a field in a structure array
1517 Solvers
-
Project Euler: Problem 16, Sums of Digits of Powers of Two
139 Solvers
-
23 Solvers
-
middleAsColumn: Return all but first and last element as a column vector
605 Solvers
-
61 Solvers
More from this Author308
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!