# Image Reconstruction Using Autofocus in Single-Lens System
## 1 Introduction  
In computational imaging, phase retrieval (PR) is a tool to reconstruct a wavefront with diffraction images [1; 2; 3; 4; 5; 6]. Recently, multi-intensity iterative algorithms [7; 8; 9; 10] have shown stronger noise robustness, however, it is easy to bring an aliasing artifact into the system. Here the diffraction intensity patterns of an object at different distances are employed to improve the convergence of phase retrieval [11; 12; 13; 14; 15; 16; 17; 18]. The single-beam, multiple-intensity reconstruction (SBMIR) algorithm [10] belongs to serial iteration. The amplitude-phase retrieval (APR) [16] is a parallel iterative algorithm that renews the complex amplitude of the target with the average of calculated data. The above iterative algorithms have been used to reconstruct the wavefront in CDI [17; 18].  
For diffraction integral models, such as angular spectrum and Fresnel diffraction, distance is a sensitive parameter for the quality of a reconstructed image. Especially in computational microscopies, higher imaging quality requires a more accurate measurement of the distance between optical elements. If the diffraction distance is inaccurate, the overall sharpness of the image will decline and the phenomenon of defocusing will occur [19; 20]. Thus, auto-focusing algorithms were considered to search for an optimal position in imaging systems [21; 22; 23; 24]. Clarity evaluation functions (CEFs) are defined by derivative, statistics, histogram, and some intuitive algorithms [25; 26; 27; 28; 29]. A well-established CEF comprises the numerical refocusing (propagation) of the recorded diffraction patterns to a set of distances and evaluating the quality of the propagated field using so-called focus metrics. The distance corresponding to the maximum or minimum of the CEF curve is considered as the indicator of the focal plane [30; 31; 32]. Different CEFs are adapted to sample images of different pixel types [33]. In a single-lens system, the autofocus of the object distance and image distance finds the mountain peak in two-dimensional space simultaneously.  
Firstly, we propose a cascaded iterative engine (CIE) based on the characteristics of single-lens CDI in this paper. The iterative process is only carried out on the diffractionplane without considering the modulation effect of the lens and the unknown object and image distances in the system. The reconstructed image is obtained after the one-time inverse diffraction and the lens modulation of the iterative result. According to the idea of serial iteration and parallel iteration, the CIE can be divided into serial CIE (SCIE) and parallel CIE (PCIE). SCIE shows good convergence characteristics and robustness. Secondly, for a case in which image distance is the only unknown parameter, the diffraction patterns are recorded from the back focal plane of the lens. We insert a diffuser into the system and combine the classic CEFs to accurately obtain the object distance. Speckle illumination improves the sensitivity and accuracy of autofocus in a single-lens CDI as compared to coherent illumination. Thirdly, in the case that both the distances are unknown, we use two error functions, mean squared error (MSE) and structural similarity (SSIM) as CEF to obtain the object distance and image distance simultaneously. This method realizes the accurate acquisition of the auto-focusing curves in three-dimensional space. Simulations and experiments have been performed to test the performance of the auto-focusing scheme.