Rank: 147027 based on 0 downloads (last 30 days) and 0 file submitted
photo

Michael Black

E-mail

Personal Profile:
Professional Interests:

 

Watch this Author's files

 

Comments and Ratings by Michael
Updated File Comments Rating
30 Jan 2009 Zernike polynomials Zernike polynomials and functions (orthogonal basis on the unit circle). Author: Paul Fricker

Looks promising but I'm having a problem duplicating the LASIK example...I copied the lasik image and edited out the the lasik portion -- but all I get from the following is a big red blob -- not a decent reconstructed image...anybody know what's wrong?
image=imread('zk_fig2_w.jpg');
figure(1);
I=im2double(image);
imagesc(image);
% make grid coordinate matrices expressed in polar coordinates
L = size(I,1);
X = -1:2/(L-1):1;
[x,y] = meshgrid(X);
x=x(:);
y=y(:);
[theta,r] = cart2pol(x,y);
% Compute the required degree and order values from n=0-7, inclusive
N = [];
M = [];
for n=0:7
N = [N n*ones(1,n+1)];
M = [M -n:2:n];
end
is_in_circle = ( r <= 1);
Z = zernfun(N,M,r(is_in_circle),theta(is_in_circle));
a = Z\I(is_in_circle);
% Reconstruct image using Zernike coefficients
r=NaN(size(I));
r(is_in_circle) = Z*a;
% rescale to 0-255 to display image
figure(2);
r = im2uint8(im2double(r));
imshow(r);

Contact us