# Weighted Constraint Iterative Algorithm for Phase Hologram Generation
## 3 Reconstruction Results  
To validate the feasibility of the WCIA, numerical simulation is performed. The measures of root-mean-square error (RMSE) and structural similarity index measure (SSIM) are used to evaluate the reconstruction quality objectively. The RMSE is calculated as follows:  
\[\text{RMSE}=\sqrt{\sum_{P}\left(\big{|}A^{\prime}_{k}\big{|}^{2}-\big{|}A_{ \text{target}}\big{|}^{2}\right)^{2}/\sum_{P}\left(\big{|}A_{\text{target}} \big{|}^{2}\right)^{2}} \tag{8}\]  
where \(P\) represents the pixel in the reconstructed image. The RMSE indicates how well the reconstructed image agrees with the target one. The SSIM is another well-known evaluation function and is given by \[\text{SSIM}=\frac{(2\mu_{t}\mu_{r}+c_{1})\cdot(2\sigma_{t,r}+c_{2})}{(\mu_{t}^{2}+ \mu_{r}^{2}+c_{1})\cdot(\sigma_{t}^{2}+\sigma_{r}^{2}+c_{2})} \tag{9}\]  
where \(\mu_{r}\) and \(\mu_{t}\) are the mean values of the reconstructed and target images, \(\sigma_{r}\) and \(\sigma_{t}\) are the standard deviations of the reconstructed and target images, \(\sigma_{t,r}\) is the covariance between the reconstructed image and target image, and \(c_{1}\) and \(c_{2}\) are constants used here to avoid the division by zero. The performances of the WCIA and GS algorithms are compared. During calculation, a \"baboon\" image (from USC-SIPI image database) with the dimensions of \(600\times 600\) was set as the signal region, and the sampling numbers of the image plane were \(1000\times 1000\), as shown in Figure 4a. The number of iterations was set as 100. The reconstruction results are shown in Figure 4b,c. The RMSEs and the SSIMs are plotted in Figure 4d,e, respectively. Figure 4b shows that the image reconstructed by the GS algorithm is degraded by the noise. Figure 4c shows that the image was precisely reconstructed by WCIA, and the noise in the non-signal region was effectively suppressed at the same time. From Figure 4d, it can be seen that the convergence rate of WCIA is faster than the GS algorithm during the iteration process. Figure 4e shows that the SSIMs of the reconstructed image with WCIA approach to nearly one after 20 iterations. The reconstruction results confirm that the weighted constraint strategy can improve the reconstruction quality in the signal region and maintains overall and effective constraint on the image plane. Figure 4: Numerical simulations: (**a**) target image; reconstructed images with (**b**) Gerchberg–Saxton (GS) algorithm and (**c**) WCIA; (**d**) comparison of the root-mean-square errors (RMSE); (**e**) comparison of the structural similarity index measures (SSIM). To further confirm that the weighted constraint strategy can effectively suppress the noise in the non-signal region with the iteration progress, the efficiency of reconstructions under different numbers of iterations was calculated. The measure of efficiency \(\eta\) is used here to evaluate the performance of the noise suppression, which is defined as the ratio of energy in the signal region compared to the total image plane. The results are shown in Figure 5. It can be seen that the noise in the non-signal region can be effectively suppressed during the iteration process based on the weighted constraint strategy. Qualitative comparisons for more gray images are given in Figure 6 for evaluating our proposed algorithm. The resolution of the test images is \(1000\times 1000\). The number of iterations was set as 100 for both the GS algorithm and WCIA. This shows that our proposed algorithm produces superior reconstruction quality and outperforms the GS algorithm across all these test images. Figure 5: Numerical reconstructions with WCIA: (**a**) 3 iterations; (**b**) 10 iterations; (**c**) 30 iterations; (**d**) 100 iterations. Figure 6: Numerical simulations: target images (**top**); reconstructed images with GS algorithm (**middle**) and WCIA (**bottom**). Image credits: Goldhill by USC-SIPI, Motorbike by [PERSON] and Earth by WikilImages.