# Image Reconstruction Using Autofocus in Single-Lens System
## 3 Simulation and Experiments  
### Comparison of the Two Iteration Methods  
PCIE and SCIE are verified in the single-lens CDI system. The numerical simulations of convergence speed and robustness are presented in Figures 4-6. The reconstructed images from PCIE and SCIE are shown in Figure 4a1-a4,b1-b4. The reconstructed result of SCIE is distinguishable and normalized correlation coefficient (NCC) reaches 1 after 100 iterations, whereas the result of PCIE is heavily degraded with the same iterations. SCIE performs well in the convergence speed compared to PCIE.  
The robustness comparison of PCIE and SCIE is proved in Figure 5[38]. A zero-mean Gaussian noise is added in all coherent patterns, and the variance of the noise is set as 0.01, 0.05, and 0.1, respectively. Figure 5a1-a3,b1-b3 show the reconstructed results under the noise of different variances by using PCIE and SCIE, respectively, after 1000 iterations. The reconstructed quality of SCIE is visually better than that of the PCIE with the same noise. The corresponding convergence curves are shown in Figure 5c. As the noise level increases, the reconstructed quality decreases for these two methods. NCC values of SCIE are always better than that of PCIE for different noise levels.  
Figure 4: Reconstructed results of PCIE and SCIE. (**a1–a4**) and (**b1–b4**) are reconstructed images; (**c**) is the logarithm of mean square error (LMSE) curves of the reconstruction results from the two modes.  
For the same condition as the previous set of simulations, Figure 6 shows the reconstructed results of the sample when the number of diffraction pattern is different. Figure 6a shows the ground truth. The speckle pattern incident on the sample is shown in Figure 6b. Figure 6a1-a8 are reconstructed results obtained by SCIE and PCIE, when the number of images is 3, 6, 9, and 11, respectively, by using diffraction patterns. Figure 6b1-b8 show this using speckle patterns. The NCC curves of PCIE and SCIE are plotted in Figure 6c1,c2 for coherent patterns and Figure 6d1,d2 are plotted for speckle patterns. The curves show that, regardless of the illumination mode, the convergence speed of SCIE is always better than PCIE. SCIE can converge after about 20 iterations, while PCIE convergence requires at least 50 iterations. SCIE achieves a good reconstruction from the results based on the simulation results above. SCIE is a better choice for reconstructing samples in the single-lens CDI system.  
Figure 5: Noise robustness of PCIE and SCIE. (**a1–a3**) the reconstructed images with the variance of 0.01, 0.05, and 0.1 for PCIE; (**b1–b3**) the reconstructed images with the variance of 0.01, 0.05 and 0.1 for SCIE; (**c**) NCC curves.  
Figure 6: Diffraction and speckle reconstructed results with different numbers of images and NCC curves. (**a**), the ground truth; (**b**), the speckle pattern; (**a1–a8**) are reconstructed images obtained by PCIE and SCIE, respectively, by using diffraction patterns, when the number of images is 3, 6, 9 and 11. (**b1–b8**) are reconstructed images using speckle patterns in the same case. (**c1,c2,d1,d2**) are the corresponding NCC curves. Digits represent the number of patterns, P, pattern.  
For a perfect sample reconstruction, object distance and image distance, according to \(z_{1}\) and \(z_{2}\) in Figure 1, are needed to be determined accurately. However, during the acquisition of the images, the distance of \(z_{2}\) can be determined manually. The focus position is identified as the starting position of the recorded image. At this time, \(z_{2}\) is the focal length of the lens L\({}_{2}\) in Figure 1. To verify the performance of the auto-focusing method proposed, the following two situations are considered.