Shack-Hartmann sensor with B-spline approximation technique