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

9.09% Correct | 90.91% Incorrect
Last solution submitted on Feb 16, 2014
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!