# Image Reconstruction Using Autofocus in Single-Lens System

^{*}

## Abstract

**:**

## 1. Introduction

## 2. Methodology

#### 2.1. Autofocus and Iterative Algorithm

- Reconstruction of the scattered out-of-focus dataset by using the intensity patterns under speckle illumination.
- Clarity evaluation of reconstructed speckle images, and curve drawing between estimated distances and clarity results.
- Reconstruction of coherent patterns by using the quasi-focus distance in step 2.

#### 2.2. Clarity Evaluation Function

#### 2.3. Image Reconstruction

- (1)
- ${I}_{n}$ represents the pattern of scattered illumination on n-th imaging plane recorded by CCD. ${U}_{n}^{k}exp\left(\mathrm{i}{\beta}_{n}^{k}\right)$ 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}\left[{U}_{n-1}^{k}exp\left(\mathrm{i}{\beta}_{n-1}^{k}\right)\right],$$
- (3)
- 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 backforward 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].$$Steps (2) and (3) will be implemented iteratively.
- (4)
- Convergence evaluation criteria in the current loop is achieved by the function$${\Delta}_{min}=\sum \left|\left|{U}_{n}^{n}\right|-\sqrt{{I}_{n}^{n}}\right|,$$

- (i)
- A specific range for object distance is selected for covering the actual distance.
- (ii)
- Supposing that $Uexp\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}\left({x}_{L},{y}_{L}\right)={\mathbf{A}}_{-{z}_{2}}\left\{U\left(x,y\right)exp\left[\mathrm{i}\beta \left(x,y\right)\right]\right\},$$$${U}_{S}\left({x}_{S},{y}_{S}\right)={\mathbf{A}}_{-{z}_{1}}\left\{t\left({x}_{L},{y}_{L}\right){U}_{L}\left({x}_{L},{y}_{L}\right)\right\},$$
- (iii)
- By changing the distance ${z}_{1}$, several recovered complex amplitudes of sample are obtained with ${U}_{Sn}$ at the distance ${d}_{n}$, which is given as$${d}_{n}={d}_{s}+\left(n-1\right)\Delta d,$$

#### 2.4. Speckle Model

## 3. Simulation and Experiments

#### 3.1. Comparison of the Two Iteration Methods

#### 3.2. Autofocus for Object Distance

#### 3.3. Autofocus for Object Distance and Image Distance

## 4. Conclusions

## Author Contributions

## Funding

## Institutional Review Board Statement

## Informed Consent Statement

## Data Availability Statement

## Acknowledgments

## Conflicts of Interest

## References

- Fienup, J.R. Phase retrieval algorithms: A comparison. Appl. Opt.
**1982**, 21, 2758–2769. [Google Scholar] [CrossRef] [PubMed] [Green Version] - Li, F.X.; Yan, W.; Peng, F.P.; Wang, S.M.; Du, J.L. Enhanced phase retrieval method based on random phase modulation. Appl. Sci.
**2020**, 10, 1184. [Google Scholar] [CrossRef] [Green Version] - Xu, Y.S.; Ye, Q.; Hoorfar, A.; Meng, G.X. Extrapolative phase retrieval based on a hybrid of PhaseCut and alternating projection techniques. Opt. Lasers Eng.
**2019**, 121, 96–103. [Google Scholar] [CrossRef] - Shan, M.G.; Liu, L.; Zhong, Z.; Liu, B.; Zhang, Y.B. Direct phase retrieval for simultaneous dual-wavelength off-axis digital holography. Opt. Lasers Eng.
**2019**, 121, 246–251. [Google Scholar] [CrossRef] - Sun, M.J.; Zhang, J.M. Phase retrieval utilizing geometric average and stochastic perturbation. Opt. Lasers Eng.
**2019**, 120, 1–5. [Google Scholar] [CrossRef] - Tsuruta, M.; Fukuyama, T.; Tahara, T.; Takaki, Y. Fast image reconstruction technique for parallel phase-shifting digital holography. Appl. Sci.
**2021**, 11, 11343. [Google Scholar] [CrossRef] - Guo, C.; Shen, C.; Tan, J.B.; Bao, X.J.; Liu, S.T.; Liu, Z.J. A robust multi-image phase retrieval. Opt. Lasers Eng.
**2018**, 101, 16–22. [Google Scholar] [CrossRef] - Bao, P.; Zhang, F.C.; Pedrini, G.; Osten, W. Phase retrieval using multiple illumination wavelengths. Opt. Lett.
**2008**, 33, 309–311. [Google Scholar] [CrossRef] - Kühn, J.; Colomb, T.; Montfort, F.; Charrière, F.; Emery, Y.; Cuche, E.; Marquet, P.; Depeursinge, C. Real-time dual-wavelength digital holographic microscopy with a single hologram acquisition. Opt. Express
**2007**, 15, 7231–7242. [Google Scholar] [CrossRef] - Pedrini, G.; Osten, W.; Zhang, Y. Wave-front reconstruction from a sequence of interferograms recorded at different planes. Opt. Lett.
**2005**, 30, 833–835. [Google Scholar] [CrossRef] - Geng, Y.; Tan, J.B.; Guo, C.; Shen, C.; Ding, W.Q.; Liu, S.T.; Liu, Z.J. Computational coherent imaging by rotating a cylindrical lens. Opt. Express
**2018**, 26, 22110–22122. [Google Scholar] [CrossRef] [PubMed] - Shen, C.; Guo, C.; Geng, Y.; Tan, J.B.; Liu, S.T.; Liu, Z.J. Noise-robust pixel-super-resolved multi-image phase retrieval with coherent illumination. J. Opt.
**2018**, 20, 115703. [Google Scholar] [CrossRef] - Guo, C.; Li, Q.; Tan, J.B.; Liu, S.T.; Liu, Z.J. A method of solving tilt illumination for multiple distance phase retrieval. Opt. Lasers Eng.
**2018**, 106, 17–23. [Google Scholar] [CrossRef] - Guo, C.; Zhao, Y.X.; Tan, J.B.; Liu, S.T.; Liu, Z.J. Multi-distance phase retrieval with a weighted shrink-wrap constraint. Opt. Lasers Eng.
**2019**, 113, 1–5. [Google Scholar] [CrossRef] - Luo, W.; Zhang, Y.; Feizi, A.; Göröcs, Z.; Ozcan, A. Pixel super-resolution using wavelength scanning. Light Sci. Appl.
**2016**, 5, e16060. [Google Scholar] [CrossRef] [Green Version] - Liu, Z.J.; Guo, C.; Tan, J.B.; Wu, Q.; Pan, L.Q.; Liu, S.T. Iterative phase-amplitude retrieval with multiple intensity images at output plane of gyrator transforms. J. Opt.
**2015**, 17, 025701. [Google Scholar] [CrossRef] - Jin, X.; Ding, X.M.; Tan, J.B.; Shen, C.; Liu, S.T.; Liu, Z.J. Wavefront reconstruction of a non-coaxial diffraction model in a lens system. Appl. Opt.
**2018**, 57, 1127–1133. [Google Scholar] [CrossRef] - Shen, C.; Tan, J.B.; Wei, C.; Liu, Z.J. Coherent diffraction imaging by moving a lens. Opt. Express
**2016**, 24, 16520–16529. [Google Scholar] [CrossRef] - Almoro, P.F.; Gundu, P.N.; Hanson, S.G. Numerical correction of aberrations via phase retrieval with speckle illumination. Opt. Lett.
**2009**, 34, 521–523. [Google Scholar] [CrossRef] - Zhu, F.P.; Lu, R.Z.; Bai, P.X.; Lei, D. A novel in situ calibration of object distance of an imaging lens based on optical refraction and two-dimensional DIC. Opt. Lasers Eng.
**2019**, 120, 110–117. [Google Scholar] [CrossRef] - Wang, X.Z.; Liu, L.; Du, X.H.; Zhang, J.; Ni, G.M.; Liu, J.X. GMANet: Gradient mask attention network for finding clearest human fecal microscopic image in autofocus process. Appl. Sci.
**2021**, 11, 10293. [Google Scholar] [CrossRef] - Yang, C.P.; Chen, M.H.; Zhou, F.F.; Li, W.; Peng, Z.M. Accurate and rapid auto-focus methods based on image quality assessment for telescope observation. Appl. Sci.
**2020**, 10, 658. [Google Scholar] [CrossRef] [Green Version] - Zhang, Y.B.; Wang, H.D.; Wu, Y.C.; Tammamitsu, M.; Ozcan, A. Edge sparsity criterion for robust holographic autofocusing. Opt. Lett.
**2017**, 42, 3824–3827. [Google Scholar] [CrossRef] [PubMed] - Sun, Y.; Duthaler, S.; Nelson, B.J. Autofocusing algorithm selection in computer microscopy. In Proceedings of the 2005 IEEE RSJ International Conference on Intelligent Robots Systems, Edmonton, Alta, 2–6 August 2005; pp. 70–76. [Google Scholar]
- Santos, A.; Solórzano, C.O.; Vaquero, J.J.; Peña, J.M.; Malpica, N.; Pozo, F. Evaluation of autofocus functions in molecular cytogenetic analysis. J. Microsc.
**1997**, 188, 264–272. [Google Scholar] [CrossRef] [Green Version] - Brenner, J.F.; Dew, B.S.; Horton, J.B.; King, J.B.; Neirath, P.W.; Sellers, W.D. An automated microscope for cytologic research a preliminary evaluation. J. Histochem. Cytochem.
**1976**, 24, 100–111. [Google Scholar] [CrossRef] [PubMed] - Yeo, T.T.E.; Ong, S.H.; Sinniah, R. Autofocusing for tissue microscopy. Image Vision Comput.
**1993**, 11, 629–639. [Google Scholar] [CrossRef] - Dwivedi, P.; Konijnenberg, A.P.; Pereira, S.F.; Urbach, H.P. Lateral position correction in ptychography using the gradient of intensity patterns. Ultramicroscopy
**2018**, 192, 29–36. [Google Scholar] [CrossRef] - Langehanenberg, P.; Kemper, B.; Dirksen, D.; Bally, G.V. Autofocusing in digital holographic phase contrast microscopy on pure phase objects for live cell imaging. Appl. Opt.
**2008**, 47, D176–D182. [Google Scholar] [CrossRef] [PubMed] - Vollath, D. The influence of the scene parameters and of noise on the behavior of automatic focusing algorithms. J. Microsc.
**1988**, 151, 133–146. [Google Scholar] [CrossRef] - Shenfield, A.; Rodenburg, J.M. Evolutionary determination of experimental parameters for ptychographical imaging. J. Appl. Phys.
**2011**, 109, 124510. [Google Scholar] [CrossRef] [Green Version] - Guo, C.; Zhao, Y.X.; Tan, J.B.; Liu, S.T.; Liu, Z.J. Adaptive lens-free computational coherent imaging using autofocusing quantification with speckle illumination. Opt. Express
**2018**, 26, 14407–14420. [Google Scholar] [CrossRef] [PubMed] - Yazdanfar, S.; Kenny, K.B.; Tasimi, K.; Corwin, A.D.; Dixon, E.L.; Filkins, R.J. Simple and robust image-based autofocusing for digital microscopy. Opt. Express
**2008**, 12, 8670–8677. [Google Scholar] [CrossRef] [PubMed] - Sun, Y.; Duthaler, S.; Nelson, B.J. Autofocusing in computer microscopy: Selecting the optimal focus algorithm. Microsc. Res. Techniq.
**2004**, 65, 139–149. [Google Scholar] [CrossRef] [PubMed] - Choi, Y.S.; Lee, S.J. Three-dimensional volumetric measurement of red blood cell motion using digital holographic microscopy. Appl. Opt.
**2009**, 48, 2983–2990. [Google Scholar] [CrossRef] - Yang, Y.; Kang, B.S.; Choo, Y.J. Application of the correlation coefficient method for determination of the focal plane to digital particle holography. Appl. Opt.
**2008**, 47, 817–824. [Google Scholar] [CrossRef] [Green Version] - Goodman, J.W. Introduction to Fourier Optics, 3rd ed.; Roberts and Company Publishers: Greenwood Village, CO, USA, 2004; pp. 154–162. [Google Scholar]
- Hardin. Centers for Disease Control and Prevention. Available online: https://phil.cdc.gov/Details.aspx?pid=22920 (accessed on 25 October 2021).
- Freund, I.; Rosenbluh, M.; Feng, S.C. Memory effects in propagation of optical waves through disordered media. Phys. Rev. Lett.
**1988**, 61, 2328–2331. [Google Scholar] [CrossRef] - Bertolotti, J. Multiple scattering: Unravelling the tangle. Nat. Phys.
**2015**, 11, 622–623. [Google Scholar] [CrossRef] - Wen, X.; Geng, Y.; Guo, C.; Zhou, X.Y.; Tan, J.B.; Liu, S.T.; Tan, C.M.; Liu, Z.J. A parallel ptychographic iterative engine with a co-start region. J. Opt.
**2020**, 22, 1–11. [Google Scholar] [CrossRef] - Wen, X.; Geng, Y.; Zhou, X.Y.; Tan, J.B.; Liu, S.T.; Tan, C.M.; Liu, Z.J. Ptychography imaging by 1-D scanning with a diffuser. Opt. Express
**2020**, 28, 22658–22668. [Google Scholar] [CrossRef] - Zhang, F.L.; Guo, C.; Zhai, Y.L.; Tan, J.B.; Liu, S.T.; Tan, C.M.; Chen, H.; Liu, Z.J. A noise-robust multi-intensity phase retrieval method based on structural patch decomposition. J. Opt.
**2020**, 22, 075706. [Google Scholar] [CrossRef] - Qin, Y.; Wang, Z.P.; Wang, H.J.; Gong, Q.; Zhou, N.R. Robust information encryption diffractive-imaging-based scheme with special phase retrieval algorithm for a customized data container. Opt. Lasers Eng.
**2018**, 105, 118–124. [Google Scholar] [CrossRef] - Wang, Z.; Bovik, A.C.; Sheikh, H.R.; Simoncelli, E.P. Image quality assessment: From error visibility to structural similarity. IEEE Trans. Image Process.
**2004**, 13, 600–612. [Google Scholar] [CrossRef] [PubMed] [Green Version]

**Figure 1.**An optical setup for single-lens CDI with coherent and speckle illumination. AS: aperture stop; ${\mathrm{L}}_{1}$, ${\mathrm{L}}_{2}$: lens; D: diffuser; S: sample; SP: sensor plane.

**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.

**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.

**Figure 7.**The performance of autofocus by coherent illumination and speckle illumination, respectively: (

**a1**,

**a2**,

**b1**,

**b2**) show the CEF curves of binary and grayscale sample respectively by using diffraction patterns; (

**c1**,

**c2**,

**d1**,

**d2**) show the CEF curves of binary and grayscale sample respectively by using speckle patterns.

**Figure 9.**The reconstructed results and normalized CEF curves. (

**a**–

**d**) are the reconstructed results; (

**c1**–

**c4**) are the CEF curves for diffraction patterns; (

**d1**–

**d4**) are the CEF curves for speckle patterns. NER: normalized evaluation result. The white bar corresponds to 620 $\mathsf{\mu}$m.

**Figure 10.**CEFs experimental results of simultaneous scanning of object and image distances: (

**a1**–

**a9**) display the CEF curves under coherent illumination; (

**b1**–

**b9**) display the CEF curves under speckle illumination.

**Figure 11.**Auto-focusing curves and sample reconstruction results. (

**a1**–

**a3**) and (

**b1**–

**b3**) are the rough auto-focusing curves of NMSE and NSSIM, respectively; (

**c1**–

**c3**) and (

**d1**–

**d3**) are the fine auto-focusing curves of NMSE and NSSIM, respectively; (

**e1**,

**e2**,

**f1**,

**f2**) are the reconstruction results using the quasi-focal distances from (

**c1**,

**d1**), respectively; (

**g**) pixel contrast curves. The white bar corresponds to 200 $\mathsf{\mu}$m.

Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |

© 2022 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Zhou, X.; Wen, X.; Ji, Y.; Li, Y.; Liu, S.; Liu, Z.
Image Reconstruction Using Autofocus in Single-Lens System. *Appl. Sci.* **2022**, *12*, 1378.
https://doi.org/10.3390/app12031378

**AMA Style**

Zhou X, Wen X, Ji Y, Li Y, Liu S, Liu Z.
Image Reconstruction Using Autofocus in Single-Lens System. *Applied Sciences*. 2022; 12(3):1378.
https://doi.org/10.3390/app12031378

**Chicago/Turabian Style**

Zhou, Xuyang, Xiu Wen, Yu Ji, Yutong Li, Shutian Liu, and Zhengjun Liu.
2022. "Image Reconstruction Using Autofocus in Single-Lens System" *Applied Sciences* 12, no. 3: 1378.
https://doi.org/10.3390/app12031378