# Grayscale Iterative Star Spot Extraction Algorithm Based on Image Entropy
## 6 Numerical Simulation and Analysis  
A series of numerical simulations are implemented to verify the detection capability of the IEGI algorithm. To realistically simulate the on-orbit working environment, we added background stray light with a uniform distribution model, linear distribution model, and Gaussian distribution model to clean star images. The parameters of these models are shown in Table 1, the simulated camera parameters are presented in Table 2, and the distribution of the star images is illustrated in Figure 5. In the case of the three types of background star maps mentioned above, the detection capability of the IEGI algorithm is compared with the max-mean filter algorithm, the max-median filter algorithm, and the Top-Hat transform algorithm. For the three types of stray light, the number of iterations of the IEGI algorithm is 1, 8, and 5, respectively. In this paper, the values of thresholds T1 and T2 of the IEGI algorithm are set to 1.5 and 1.8, respectively. The number of correctly extracted star spots, the number of false star spots, and the running time are used as extraction capability indexes. A higher number of correctly extracted star spots and a lower number of false star spots indicate stronger detection capability. The results of the star spot extraction by the four algorithms are shown in Table 3, where green circles represent correctly extracted star spots and red squares indicate false star spots. The mean number of correctly extracted star spots and false star spots from 100 repetitions of the simulation experiment are shown in Figures 6 and 7, respectively. The running times of various algorithms are shown in Table 4. The simulation platform was a Windows 10 system with MATLAB software (R2020a). Figure 4: Flowchart of star spot extraction process based on the IEGI algorithm. \begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Uniform Distribution Model** & \multicolumn{2}{c}{**Linear Distribution Model**} & \multicolumn{2}{c}{**Gaussian Distribution Model**} \\ \hline \(g_{max}=190\) & \(\alpha=10\) & \(g_{max}=190\) & \(g_{min}=50\) & \(N_{B}=618\) & \(\alpha=10\) & \(Y\sim(-300,16,000)\) \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Parameters of different models of background stray light. \begin{table}
\begin{tabular}{c c} \hline \hline
**Parameters** & **Values** \\ \hline Image resolution & \(512\times 512\) \\ Field of view & \(7.5^{\circ}\) \\ Focal length/mm & \(78.1\) mm \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Camera parameters. Figure 5: Simulated star images: (**a**) simulated star image without stray light; (**b**) simulated star image with uniformly distributed stray light; (**c**) simulated star image with linearly distributed stray light; (**d**) simulated star image with Gaussian distributed stray light. Figure 6: The correct number of star spot extractions under different stray light conditions. Figure 7: The number of false star spots under different stray light conditions. Figure 5a shows a simulated star image with the line-of-sight direction at (313.7764, \(-\)0.1315), containing 132 star spots with a brightness above 7.5 Mv. Figure 5b presents a simulated star image with uniformly distributed stray light, where the stray light grayscale values follow a uniform distribution within the range [190, 200]. Star spots with maximum grayscale values below 200 are completely obscured. Star spots with grayscale values above 200 are retained and can be discerned with the naked eye. Figure 5c depicts a simulated star image with linearly distributed stray light, where the stray light grayscale values follow a linear distribution within the range [200, 60], causing star spots on the left side of the image to be completely obscured. Figure 5d illustrates a simulated star image with Gaussian-distributed stray light, where the stray light grayscale values follow a Gaussian distribution within the range [200, 0]. The background grayscale values are similar to those in Figure 5c, but more star spots are retained.