Space-variant Shack-Hartmann wavefront sensing based on affine transformation estimation.