### Highlights from Zernike decomposition

4.71429
4.7 | 7 ratings Rate this file 22 Downloads (last 30 days) File Size: 1.58 KB File ID: #17950 Version: 1.0

# Zernike decomposition

### Alex Chtchetinine (view profile)

10 Dec 2007 (Updated )

Decomposition of a 2-D function by set of Zernike functions

File Information
Description

This code was written to deal with "Zernike polynomials" code graciously donated by Paul Fricker via file exchange.
Here you will find a practical example of a function decomposition by
Zernike basis.
The function is F below, feel free to modify
Unlike Paul's example found in 'zernfun2.m' here the domain is the true unit circle, without NaN's filling it up to the unit square.

Acknowledgements

Zernike Polynomials inspired this file.

MATLAB release MATLAB 7.5 (R2007b)
Other requirements Code ID#7687 by Paul Fricker
16 Apr 2016 marwa melki

### marwa melki (view profile)

think you

Comment only
07 Apr 2014 Alexander

### Alexander (view profile)

Thank you for sharing, Alex. Good means for quick and robust illustration of Zernike decomposition.

09 Nov 2012 Francesco

### Francesco (view profile)

I'm using this code to decompose a wave aberration function. I'm experiencing a problem with the decomposition. Why if I try to expand a function like
F = A*r^4
where A is constant, I get 2 non-negative coefficients: not only the coefficient corresponding to spherical aberrations but also that one who correspond to Field Curvature ?!?!
thanks

16 Jul 2010 Eric

### Eric (view profile)

This is an extraordinarily slow way of fitting Zernike coefficients. See "Wavefront fitting with discrete orthogonal polynomials in a unit radius circle" by Malacara, et al, in Optical Engineering, Vol 29, No 6, pages 672-675 for a much more efficient, least-squares approach. You can speed the decomposition up significantly by using linear algebra functions rather than interp2() and dblquad().

13 Nov 2009 Alex Kararg

### Alex Kararg (view profile)

Any idea if there is a Matlab code for decomposing a 3D shape to Zernike descriptors? Thanks!

Comment only
31 Dec 2008 Shalin Mehta

### Shalin Mehta (view profile)

This is a good code for illustrating the idea of Zernike decomposition

18 Sep 2008 Xame Earnest

This helps, thanks!

19 May 2008 aaaa bbbb

Very well done, thanks!

03 Jan 2008 Greg Noder

Thank you, runs smoothly.