# Experimental Investigation of Anisotropic Diffusion Applied in Ghost Imaging Reconstruction
## 2 Experimental Setup and Principle
However, choosing too small an \(m\) will result in excessive smoothing, even blurring of the image, but too large an \(m\) will cause the image to stop spreading in advance, which may make the denoising effect worse. Therefore, giving a suitable value of \(m\) can make the processed image have good denoising performance, and more features can be extracted from the edge details. In image processing, the image is considered as a group of pixels, and the diffusion process occurs when computation is conducted among the target pixel with its four adjacent pixels. Therefore, Equation (2) can be transformed into the following form by the nonlinear discrete transformation:  
\[u^{t+1}-u^{t}=\lambda(c_{N}\
abla_{N}u^{t}+c_{S}\
abla_{S}u^{t}+c_{E}\
abla_{ E}u^{t}+c_{W}\
abla_{W}u^{t}), \tag{4}\]  
where the discrete time variable t can be used to represent the number of diffusions, \(0\leq\lambda\leq 1/4\) must be satisfied for the numerical scheme to be stable, N, S, E and W are abbreviations for north, south, east and west, respectively, which are utilized to expressed the four nearest-neighbor directions of the diffusion, and the gradient functions in the four directions can be expressed as follows:  
\[ \begin{array}{l}\
abla_{N}u^{t}=u^{t}(x-1,y)-u^{t}(x,y)\\ \
abla_{S}u^{t}=u^{t}(x+1,y)-u^{t}(x,y)\\ \
abla_{E}u^{t}=u^{t}(x,y-1)-u^{t}(x,y)\\ \
abla_{W}u^{t}=u^{t}(x,y+1)-u^{t}(x,y)\\ \end{array} . \tag{5}\]  
The diffusion coefficients in the four directions are expressed as:  
\[ \begin{array}{l}c_{N}=g(|\
abla_{N}u|)\\ c_{S}=g(|\
abla_{S}u|)\\ c_{E}=g(|\
abla_{E}u|)\\ c_{W}=g(|\
abla_{W}u|)\\ \end{array} . \tag{6}\]  
In the following experiment, considering the balance between eliminating noise and protecting edges, we set the thermal conductivity coefficient \(m\) to 15, the smoothing coefficient \(\lambda\) to 0.15 and the diffusion time \(t\) is set to 20 [30]. Assuming that the measurement times are \(N\), the object image and the optical fields distribution of the reference beam are both \(p\times q\) pixels. The \(I_{n}(x,y)\) consists of a row vector, and then these \(N\) row vectors are pieced together into a matrix expressed as an observation matrix \(\Phi\) and the Bn measurements of \(N\) times constitute an \(N\)-dimensional column vector B. The GI formula can be expressed in the form of a matrix:  
\[\mathbf{T}_{GI}=\frac{1}{N}\mathbf{\Phi}^{T}\mathbf{\Phi}\mathbf{T}-\langle B _{n}\rangle\left[ \begin{array}{c}\langle I_{n}(1,1)\rangle\\ \langle I_{n}(1,2)\rangle\\ \vdots\\ \langle I_{n}(p,q)\rangle\\ \end{array} \right], \tag{7}\]  
where the \(\langle\cdots\rangle\) denotes the ensemble average of the values in the symbol and T equals \(\left[ \begin{array}{cccc}\mathbf{T}(\mathbf{1},\mathbf{1})&\mathbf{T}( \mathbf{1},\mathbf{2})&\cdots&\mathbf{T}(p,\boldsymbol{q})\end{array} \right]^ {T}\). As the number of measurement times increases, the second term in Equation (1) tends to be a constant and barely affects the quality of the reconstructed image, so it can be deleted. Since the closer \(\mathbf{\Phi}^{T}\mathbf{\Phi}\) is to the scalar matrix, the better reconstruction results will be obtained, and the pseudo inverse matrix \(\mathbf{\Phi}^{T}\) is replaced by PGI. PGI replaces \(\mathbf{\Phi}^{T}\) with its pseudo-inverse matrix. \[\mathbf{T}_{PGI}=\frac{1}{N}\mathbf{\Phi}^{\dagger}\mathbf{B}=\frac{1}{N} \mathbf{\Phi}^{\dagger}\mathbf{\Phi}\mathbf{T}, \tag{8}\]where the matrix \(\mathbf{\Phi^{\dagger}\Phi}\) can be expressed as the sum of two matrices \(\mathrm{s}\) and \(\mathrm{n}\), where \(\mathrm{s}=\mathrm{diag}(\mathbf{\Phi^{\dagger}\Phi})\) and \(\mathrm{n}=\mathbf{\Phi^{\dagger}\Phi-s}\). Theoretically, when \(\mathrm{s}\) is close to a scalar matrix and \(\mathrm{n}\) is similar to a zero matrix, the reconstructed image of PGI will be close to the original image of the object. Therefore, (1/\(N\)) nT is the actual noise in the PGI reconstruction, and its presence obscures the image. IPGI constructs the noise interference term using the reconstructed image of PGI without prior information.