# Image Transmission through Scattering Media Using Ptychographic Iterative Engine
## 2 Methods  
The proposed method uses a probe aperture to scan the target and a camera to record the speckle intensity which is formed after the light from the probed area passes through a scattering medium. The size of the probe beam is small enough to make sure it is within memory effect range. When a raster scan is complete, the camera captures a series of speckle patterns:  
\[I_{j}(r)=O(r)P(r-r_{j})*S_{j}(r)=o_{j}(r)*S_{j}(r),\quad j=1,\ldots,J, \tag{3}\]  
where \(O(r)\) denotes the target which is much larger than the memory effect range, \(P(r-r_{j})\) is the probe aperture translated by a known amount \(r_{j}\), \(S_{j}(r)\) is the point spread function in the corresponding area of \(P(r-r_{j})\), and \(o_{j}(r)=O(r)P(r-r_{j})\) for the simplicity of description. The point spread functions in different probe apertures is unnecessarily correlated. In this way, we could record a series of speckle patterns carrying information about the target at different local areas. The proposed method is to calculate the autocorrelation functions directly from these speckle patterns, the Fourier transforms of which are actually the power spectra of each probed part of the target:  
\[\Psi_{j}(q)=\mathcal{F}\{I_{j}(r)\star I_{j}(r)-C\}=|\mathcal{F}\{o_{j}(r)\}| ^{2}, \tag{4}\]  
where \(\mathcal{F}\) stands for the Fourier transform and \(q=(f_{x},f_{y})\) is the two-dimensional spatial frequency coordinate. Equation (4) indicates that from the collected speckle patterns, one can obtain the far-field diffraction patterns \(\Psi_{j}(q)\) corresponding to the selected regions \(P(r-r_{j})\) of the target. From these patterns, the proposed method reconstructs the target image by PIE. The framework of the PIE algorithm is similar to the conventional one [21; 22]. Figure 1 shows the procedure, which is composed of the following steps:  
1. The algorithm starts with an initial estimation of the target function \(\hat{O}_{1}(r)\). In our implementation, the initial guess was a real and non-negative random matrix. 2. Multiply the estimated target function obtained at the \(n^{\text{th}}\) iteration with the aperture function at the current position: \[\hat{o}_{n,j}(r)=\hat{O}_{n}(r)P(r-r_{j}),\quad n=1,\dots,N,\] (5) where \(\hat{O}_{n}(r)\) is the estimated object at \(n^{\text{th}}\) iteration, \(P(r-r_{j})\) is the probe aperture as we know prior, and \(\hat{o}_{n,j}(r)\) is the estimated probed object at \(n^{\text{th}}\) iteration. 3. Fourier transform the result calculated at step 2. \[\hat{A}_{n,j}(q)\exp[i\phi_{n,j}(q)]=\mathcal{F}\{\hat{o}_{n,j}(r)\}\] (6)
4. Replace the magnitude of the Fourier spectrum obtained at step 3 with the measured data and keep the phase unchanged: \[\hat{A}^{\prime}_{n,j}(q)=\sqrt{\Psi_{j}(q)},\] (7) where \(\Psi_{j}(q)\) is calculated from Equation (4) from the collected speckle patterns. 5. Inversely Fourier transform the updated spectrum back to the object plane: \[\hat{o}^{\prime}_{n,j}(r)=\mathcal{F}^{-1}\{\hat{A}^{\prime}_{n,j}(q)\exp[i \phi_{n,j}(q)]\},\] (8) where \(\mathcal{F}^{-1}\) is the inverse Fourier transform. 6. Update the target image within probe aperture \(P(r-r_{j})\) via: \[\hat{O}_{n+1}(r)=\hat{O}_{n}(r)+\beta(\hat{o}^{\prime}_{n,j}(r)-\hat{o}_{n,j} (r)),\] (9) where \(\beta\in[0.9,1.0]\) is a feedback parameter to controls the amount of importance of the result from previous step in the algorithm. 7. Move to the next aperture position \((j\gets j+1)\) and repeat steps 2-6. 8. Repeat steps 2-7 and sequentially update the object function \((n\gets n+1)\) until the algorithm converges. Figure 1: Diagram of the ptychographic iterative engine (PIE) algorithm.