# Grayscale Iterative Star Spot Extraction Algorithm Based on Image Entropy
## 3 Analysis of Mechanism for Star Image Background Stray Light  
When a star tracker operates in space, it often suffers from stray light interference. Research has shown that the grayscale values in the background light areas are not exactly the same but fluctuate within a small range. There are mainly two types of stray light in star images [32]: (1) stray light generated by illuminating devices, whose grayscale values follow a uniform or linearly distributed decay within the range of stray light; (2) stray light caused by moonlight glow, for which the grayscale distribution is similar to a Gaussian model of star spots but with a larger range. If the grayscale value of the stray light is too high, causing the star image to saturate, star spots will be completely obscured and cannot be extracted. It is recommended to change the line of sight direction and re-shoot the star image. The background light objects studied in this paper are all unsaturated.  
In order to systematically study the background stray light in star images, real star images containing background stray light are analyzed. Three types of distribution models of stray light are studied [33; 34]: uniform distribution model, linear distribution model, and Gaussian distribution model. The grayscale matrices of the three model images are all \(512\times 512\), denoted as \(I_{x}\), \(I_{y}\) and \(I_{j}\), respectively. The following are the simulation equations for the three types of background stray light:  
(1) Uniform distribution of background stray light: this type of background stray light fills the entire star image, with a relatively uniform grayscale distribution. The calculation equation is as follows:  
\[I_{x}=g_{max}+\alpha\cdot rand \tag{3}\]  
where \(I_{x}\) represents the grayscale values of the background with uniform stray light, \(g_{max}\) is the maximum grayscale value of the stray light, \(\alpha\) is the upper limit of the range of grayscale value fluctuations, and \(rand\) is a random distribution function in the range [0, 1].  
(2) Linear distribution of background stray light: this type of stray light generally starts from one end of the star image and gradually decays in grayscale values as it extends toward the other end. The calculation equation is as follows:  
\[I_{y}=A\times\left(G-\frac  
512 elements; and \(N_{B}\) is the number of elements in vector \(B\). The definitions of \(A\) and \(B\) are as follows:  
\[\left\{\begin{array}{l}G=\left[g_{max}\ g_{max}\ \cdots\ g_{max}\right]_{1 \times 512}\\ A=\left[1\ 1\ \cdots\ 1\right]_{1\times 512}^{T}\\ B=\left[1\ 2\ \cdots\ 512\right]_{1\times 512}\end{array}\right. \tag{5}\]  
(3) Gaussian distribution of background stray light: this type of stray light appears from one end of the star image and rapidly decays to 0 following a Gaussian distribution, occupying half of the star image. The calculation equation is as follows:  
\[I_{j}=A\times Y \tag{6}\]  
where \(Y\) represents the Gaussian distribution function along the image plane \(x\)-axis direction. In this Gaussian background stray light, the specific parameters and characteristics of the Gaussian distribution function can be determined based on the desired characteristics of the stray light in the image.