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
- 
         
         6950 Solvers 
- 
         How to find the position of an element in a vector without using the find function 2775 Solvers 
- 
         Make an awesome ramp for a tiny motorcycle stuntman 725 Solvers 
- 
         
         497 Solvers 
- 
         Get the elements of diagonal and antidiagonal for any m-by-n matrix 502 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!