Modal Shack-Hartmann wavefront sensor toolbox for MATLAB
MATLAB toolbox to estimate wavefronts from Shack-Hartmann (SHWFS) images. This toolbox implements the modal-based wavefront reconstruction method described in Section 1.3.2 of [1]. It also contains code to generate and plot Zernike polynomials as defined by Noll [2].
The calibration step is necessary to lay the grids for your particular arrangement of subapertures, select the pupil size, and to enable or disable single subapertures. For this step you should use a reference SHWFS image, i.e., an image taken with a reference beam that is aberration free.
To perform the calibration, open calibration.m
,
>> cd examples/
>> edit calibration.m
You can run the calibration using the example SHWFS reference image found in
examples/data/sh_flat.mat
. To use your own SHWFS reference image:
load sh_flat_bg.mat
with your background reference image (dark frame).load sh_flat.mat
with your SHWFS reference image, i.e., an image taken with your SHWFS when no aberration is presentOnce the calibration is complete, you can estimate the wavefront from an arbitrary SHWFS image. An example is provided in reconstruction.m
. To use your own images, just replace load img.mat
.
[1] J. Antonello, "Optimisation-based wavefront sensorless adaptive optics for microscopy," Ph.D. thesis, Delft University of Technology (2014).
[2] Robert J. Noll, "Zernike polynomials and atmospheric turbulence," J. Opt. Soc. Am. 66, 207-211 (1976).