The wavefront passed through the atmosphere will produce different degree of distortion, due to atmospheric disturbances, defocus, aberration and etc. Distortion of wavefront can result in image degradation. Conventional methods typically use adaptive optics to correct the degradation. Correction system is complex and requires three parts, including wavefront detection, wavefront reconstruction, wavefront correction, and each part requires very precise control. In order to simplify the system structure, we use Hartmann - Shack wavefront sensor to get wavefront information, and then reconstruct the degenerated image using software restoration method. The paper introduces the background and significance of Hartmann-Shack wavefront sensor, summarizes the wavefront reconstruction principle. Then we analyze the general model of optical transfer function (OTF) and the way to calculate the OTF of diffraction limited incoherent image system. Take the actual situation into consideration, wavefront distortion is unavoidable, so we deduce the method to calculate OTF with wavefront distortion. Based on different wavefront detection error and the image restoration quality, we concluded the allowed maximum detection error under different peak value of wavefront.