# Image Reconstruction Using Autofocus in Single-Lens System
## 2 Methodology
### Image Reconstruction  
In lensless CDI, iterative calculations start from the sample plane after assuming the amplitude and phase of the sample. In single-lens CDI, for our CIE, only the known information is used for iteration. The sample, object distance, and image distance are not considered during iteration, and the modulation effect of the lens is temporarily avoided. The result of the iteration is the diffraction image on the first recoding plane, and the reconstructed sample is obtained after inverse diffraction and lens modulation. The process of PCIE is is given as follows: (1) We use the square root of the intensity pattern on the first recording plane while keeping the phase information unchanged; (2) Forward propagation in turn until all recording planes are traversed; (3) Inverse diffraction propagation to the first recording plane; (4) The above iterative process is repeated to obtain the reconstructed first recording plane diffraction image; (5) Inverse diffraction propagation to the object plane to obtain the reconstructed sample image, as shown by the purple arrows in Figure 3. In SCIE, the diffraction patterns of each recording plane are processed separately, and the estimated average values are used as the output result of each iteration. Finally, it is inverse-diffracted to the object plane as shown by the blue arrows in Figure 3.  
The procedure of the CIE is represented as follows:  
1. \(I_{n}\) represents the pattern of scattered illumination on \(n\)-th imaging plane recorded by CCD. \(U_{n}^{k}\exp(\mathrm{i}\beta_{n}^{k})\) represents the \(k\)-th complex-value guess when the image is on the \(n\)-th plane. 2. The light field functions of two adjacent imaging surfaces are propagated by the angular spectrum method as \[U_{n}^{k}\exp\left(\mathrm{i}\beta_{n}^{k}\right)=\mathbf{A}_{d}\Big{[}U_{n-1 }^{k}\exp\left(\mathrm{i}\beta_{n-1}^{k}\right)\Big{]},\] (10) where \(\mathbf{A}_{d}\) is forward angular spectrum propagation operator with a distance \(d\). During the iteration, the real part \(U_{n}^{k}\exp\left(\mathrm{i}\beta_{n}^{k}\right)\) of \(k\)-th complex-value guess on the plane P\({}_{n}\) is replaced by the root of measured intenisty \(I_{n}\). The intervals between the adjacent detecting positions are equal in simulations and experiments. Figure 3: The flowchart of CIE. SL: single lens. When the iteration runs on the last diffraction plane \(n=N\), the synthesized complex amplitude propagates backward to the first plane \(\mathrm{P}_{0}\). And, \(\mathbf{A}_{-N\mathrm{d}}\) represents the background angular spectrum propagation operator. The complex amplitude at the plane \(\mathrm{P}_{0}\) is replaced with \[U_{0}^{k+1}\exp\left(\mathrm{i}\beta_{0}^{k+1}\right)=\mathbf{A}_{-N\mathrm{d} }\left[U_{N}^{k}\exp\left(\mathrm{i}\beta_{N}^{k}\right)\right].\] (11) Steps (2) and (3) will be implemented iteratively. 4. Convergence evaluation criteria in the current loop is achieved by the function \[\Delta_{\text{min}}=\sum\left|\left|U_{n}^{n}\right|-\sqrt{I_{n}^{n}}\right|,\] (12) The above steps describe the process of closed loop iteration. Based on the data set retrieved above, the auto-focusing process is listed as follows: 1. A specific range for object distance is selected for covering the actual distance. 2. Supposing that \(U\exp\left(\mathrm{i}\beta\right)\) is the complex amplitude at the plane \(\mathrm{P}_{0}\) after \(M\) iterations, the complex amplitude of sample is obtained by back propagation and is expressed as \[U_{L}(x_{L},y_{L})=\mathbf{A}_{-z_{2}}\{U(x,y)\exp\left[\mathrm{i}\beta(x,y) \right]\},\] (13) \[U_{S}(x_{S},y_{S})=\mathbf{A}_{-z_{1}}\{t(x_{L},y_{L})U_{L}(x_{L},y_{L})\},\] (14) where \(U_{L}\) and \(U_{S}\) are complex amplitudes at the plane \(P_{L}\) and the sample plane, respectively. The function \(t(x,y)\) is the phase of the lens \(\mathrm{L}_{2}\). 3.