1. Introduction
Star trackers are key components for the autonomous attitude determination of aerospace vehicles, characterized by high-precision attitude determination, high autonomy, and low power consumption, with broad application prospects [
1,
2,
3]. Star trackers estimate the spacecraft’s attitude, such as deep space probes and planetary explorers, by extracting the positions of star spots in star images [
4,
5,
6]. Star spot extraction, as a crucial and fundamental step in star tracker design, determines the effectiveness and accuracy of star image recognition, attitude calculation, and target tracking [
7,
8,
9,
10,
11]. During the positioning process, star trackers often face challenges in distinguishing star spot targets from background light interference caused by sunlight, moonlight, cosmic rays, and atmospheric light, leading to ineffective star sensor attitude data and the inability to extract the desired targets [
12,
13,
14,
15,
16]. Therefore, suppressing stray light interference and accurately extracting spot position in star trackers have become important research topics.
The existing star spot extraction methods roughly fall into two categories: single-frame-based and multi-frame-based [
17,
18]. Single-frame algorithms include local information-based and non-local information-based algorithms, and multi-frame algorithms include correlation verification multi-frame algorithms and direct calculation multi-frame algorithms [
19,
20,
21,
22,
23]. Multi-frame algorithms, such as background subtraction, use multiple frames to jointly differentiate between targets and background in images, which can reduce stray light interference to a certain extent [
24]. However, such methods require caching multiple frames, occupying a large amount of storage space, which is a major drawback in space missions. Traditional single-frame algorithms have poor adaptability in determining thresholds locally, making it difficult to distinguish between targets and background in the presence of background stray light [
25]. To address background light interference in single-frame images and improve target detection rates in on-orbit hardware platforms, two main effective methods are currently utilized: morphological filtering and background estimation.
Theoretically, the background estimation method is simple in principle and easy to implement. For example, the authors of [
26] used a small window to traverse the original image and selected the gray intermediate value of several pixels around the central pixel as the grayscale value of the current position (GVCP). After the difference, the position of the target can be clearly seen. The max–mean filter and the max–median filter algorithm divide the filtering template into multiple directions, calculate the filtering results, and take the maximum value in each direction as GVCP, which in essence makes use of the difference between the background edge and the target in the directional information to achieve the purpose of suppressing the edge [
27]. However, when the background in the field of view of the detector is very complex, the background obtained by the traditional filtering method is likely to be inaccurate. In this case, after the next difference, it is easy to obtain a large number of false targets, which is not conducive to the detection of real dim and small targets. The morphological method is also convenient to implement and has good parallelism and fast processing speed. For example, in [
28,
29,
30], the authors improved the structural window of the traditional Top-Hat algorithm, which quickly gained widespread application. However, determining the optimal size of the structural window is the primary challenge faced by morphological methods in practical applications.
In summary, several commonly used methods in current hardware platforms have their limitations. To overcome these challenges, this paper proposes a new grayscale iterative star spot extraction algorithm based on image entropy. In contrast to the existing pixel-to-object extraction algorithms, this algorithm belongs to an object-to-pixel star spot extraction method in the presence of a stray light background. The main contributions can be summarized as follows:
- (1)
Based on the star spot imaging model, three types of background stray light distribution models in star images are analyzed in detail. A grayscale iterative image preprocessing algorithm is proposed, which fully utilizes prior information regarding the local contrast of star spot targets, effectively filtering out background noise to a certain extent.
- (2)
After image preprocessing, using the algorithm proposed in this paper, we establish a sliding window for star spot extraction based on inner–outer templates to traverse the star image and extract star spots using the image entropy algorithm. This method treats N neighboring pixels of a star spot as a single entity, directly matching all pixels of the star spot with the target. This represents a significant breakthrough compared to the existing pixel-to-object extraction methods.
- (3)
Numerical simulations and experimental results demonstrate that, compared to traditional detection algorithms, this method exhibits superior resistance to stray light, increases star spot extraction rates, reduces the number of false stars, and shows good robustness (see
Section 6 and
Section 7).
The content of this paper is arranged as follows: In
Section 2, we provide a detailed introduction to the star spot imaging model. In
Section 3, we analyze the mechanism for star image background stray light. In
Section 4, we propose a grayscale iterative image preprocessing method. In
Section 5, we establish a numerical method to extract star spots from the preprocessed star image. In
Section 6 and
Section 7, we implement a series of numerical simulations and experiments. Finally, we conclude in
Section 8.
2. Star Spot Imaging Model
When the star image does not contain any background light or noise, the grayscale value of its background pixels should theoretically be 0. Stars have varying intensities of starlight, which is reflected in the different sizes and brightness of star spots on the star image. The stronger the starlight of a star is, the brighter and larger the star spot it projects on the star image. Conversely, the weaker the starlight of a star is, the darker and smaller the star spot it projects on the star image. The energy distribution of stars on the focal plane of a star tracker can be approximated by a two-dimensional Gaussian function model [
31] as follows:
where
is the energy distribution function of the star spot,
is the total energy of the star spot on the focal plane,
is the true center coordinates of the star spot,
and
are the Gaussian radii corresponding to the Gaussian surface model in the
x-axis and
y-axis directions, and
is the correlation coefficient. For simplicity in calculation, it is generally assumed that
and
= 0; thus, the equation can be simplified as follows:
where
stands for the Gaussian radius.
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 × 512, denoted as
,
and
, 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:
where
represents the grayscale values of the background with uniform stray light,
is the maximum grayscale value of the stray light,
is the upper limit of the range of grayscale value fluctuations, and
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:
where
represents the grayscale values of the background with linearly distributed stray light;
and
are the maximum and minimum grayscale values of the stray light, respectively;
is a column vector with 512 elements;
and
are row vectors with 512 elements; and
is the number of elements in vector
. The definitions of
and
are as follows:
(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:
where
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.
4. Image Preprocessing Based on Grayscale Iteration
Accurately detecting star spots in star images is the foundation for star trackers to extract star spot centroids, solve star attitudes, and extract targets. Due to the interference of stray light, the overall grayscale of star images captured by star trackers increases, resulting in poor background uniformity, leading to low star spot extraction rates and a high number of false star spots. To address this issue, this paper proposes a grayscale iterative image preprocessing algorithm that effectively filters out background noise and enhances the local contrast of the targets.
When the star tracker acquires a star image containing stray light, let the grayscale values of each pixel in the star image be denoted as
. The average grayscale value
of the star image is calculated using the following equation:
where
represents the grayscale value of each pixel in the star image, and
is the number of pixels in the star image with non-zero grayscale values. Subtracting the average grayscale value
from the grayscale value of all pixels yields a new image denoted as
, with the equation as follows:
After the aforementioned steps, image regions with grayscale values less than
are eliminated from the stray light background. To maintain the reliability of star spot information as much as possible, the entire star image undergoes grayscale stretching, with the calculation equation as follows:
where
represents the grayscale value of the star image after the
-th iteration,
is the maximum grayscale value in the image, and
is the pixel bit width.
Grayscale iteration can effectively remove background stray light, and its removal extent and the accuracy of star spot extraction are related to the number of iterations of this algorithm. Before the iteration starts, due to the interference of background stray light, it is almost impossible to extract connected regions or only a few connected regions can be extracted. As the number of iterations increases, the background is gradually removed, and the number of connected regions that can be extracted also increases. However, during this process, a large number of false star spots may appear. Therefore, it is stipulated that when the number of extracted connected regions reaches the maximum value, the iteration continues, and the noise will be gradually removed, causing the number of connected regions to decrease gradually. However, when the number of extracted connected regions is equal to the number of star spots that can be retained, if the iteration continues, it will gradually remove the dim and fainter star spots, leading to the loss of star spots. Therefore, when the following conditions are met, the iteration should be stopped:
where
represents the number of connected regions extracted after the
-th iteration; specifically,
is the number of connected regions when the star image has not undergone grayscale iteration. To ensure that the extracted star spot information is sufficient for star image recognition, the stopping condition of the iteration needs to satisfy
greater than
to prevent extracting only a small number of star spots for two consecutive iterations, while there are still other star spots that can be extracted in the star image, leading to errors and omissions in the star spot information. Based on prior information, star spots typically occupy only 3 × 3 pixels on the focal plane. Therefore, when the number of pixels in a connected region exceeds this threshold, the connected region should be excluded. When the number of pixels in a connected region is 1, it is generally considered noise and should be excluded. After grayscale iteration, star spot extraction is carried out using an inner–outer template 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
Figure 6 and
Figure 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 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.
As can be seen from
Table 3, for uniformly distributed stray light, the max–mean filter algorithm effectively extracts the star spots from the star images without any false star spots. However, for linearly distributed stray light and Gaussian-distributed stray light, the max–mean filter algorithm results in a significant number of missing star spots in the areas with higher grayscale values on the left side, and there are a few false star spots. For all three types of stray light, the max–median filter algorithm results in the extraction of star spots with a significant number of missing star spots and a considerable number of false star spots. For the uniformly distributed stray light star images, the Top-Hat algorithm effectively extracts the star spots. However, for the linearly distributed and Gaussian distributed stray light star images, the Top-Hat algorithm results in missing star spots in the areas with higher grayscale values on the left side. Additionally, there are a few false star spots present in the extraction results for all three types of stray light. As shown in the fifth row of
Table 3, for the three types of simulated star images with stray light in
Figure 5, the IEGI algorithm successfully extracts most of the star spots from the original star images without any false star spots. From
Table 3, it can be qualitatively observed that, compared to the other three small target detection algorithms, the IEGI algorithm has the greatest number of green circles and the fewest red squares in its extraction results. This indicates that it has the highest number of correctly extracted star spots and the lowest number of false star spots.
From
Figure 6, it can be quantitatively observed that the IEGI algorithm achieves the highest number of correctly extracted star spots for three types of stray light simulated star images, with values of 132, 130, and 131, respectively, which are closest to the actual number of star spots. For uniformly distributed stray light, the max–mean filtering algorithm and the Top-Hat algorithm show star spot detection results that are close to the IEGI algorithm. However, for star images with the linear distribution and Gaussian distribution of stray light, these two algorithms yield a smaller number of correctly extracted star spots, resulting in the omission of many star spots. For the three types of star images with different types of stray light, the max–median filtering algorithm has the lowest number of correctly extracted star spots. From
Figure 7, it can be observed that for the three types of simulated star images with different types of stray light, the IEGI algorithm shows no false star spots in the extraction results, while the other three detection algorithms have a significant number of false star spots.
From
Table 4, we observe that the IEGI algorithm requires implementing multiple iterations before obtaining a satisfactory solution, and the reconstruction time is the longest among the competing algorithms. In the future, the proposed star point extraction algorithm should be further studied to improve the computing efficiency.
In conclusion, from the perspective of removing stray light backgrounds and accurately extracting star spots, the IEGI algorithm proposed in this paper demonstrates the effective removal of stray light backgrounds with three different distribution models, yielding consistent extraction results. The algorithm is capable of accurately extracting star spots with maximum grayscale values greater than the maximum grayscale values of the stray light. The IEGI algorithm outperforms the other three traditional detection algorithms.
7. Experiment and Analysis
To further validate the target detection capability of the IEGI algorithm under stray light interference, a series of experiments were conducted outdoors, collecting multiple real-life images containing stray light conditions. The camera parameters are shown in
Table 2. The real-life star images are shown in
Figure 8. In
Figure 8a, there is a large area of stray light in the lower left corner. In
Figure 8b, there are large areas of stray light on the left and bottom sides. In
Figure 8c, there is a large area of stray light at the bottom, and there are also large cloud layers blocking the star spots. These factors make the detection of star spot targets challenging. For the purpose of facilitating a comparison of extraction effectiveness, we analyzed the right ascension and declination of the three different operational conditions’ lines of sight. Based on a star catalog, the actual star image corresponding to this orientation was obtained, as shown in
Figure 9. In response to the captured real-life star images, we utilized the max–mean filtering algorithm, the max–median filtering algorithm, the Top-Hat algorithm, and the IEGI algorithm for star spot extraction, with the detection results presented in
Table 5. For the three types of stray light conditions in
Figure 8, the number of iterations of the IEGI algorithm was 8, 9, and 13, respectively. The corresponding grayscale value distribution of the detection results is shown in
Table 6, and the comparison of the correct number of star spots, the number of false star spots, and the detection rate (
) and error rate (
) in their extraction results are presented in
Figure 10 and
Figure 11, and
Table 7, respectively. The calculation formulas for the detection rate and error rate are as follows:
where
is the number of correctly detected star spots,
is the number of falsely detected star spots, and
is the total number of actual star spots.
Table 5 shows that, for the three types of stray light conditions in
Figure 8, the max–mean filtering algorithm and max–median filtering algorithm extract very few correct star spots. Particularly, in the regions with stray light distribution, all star spots are missing, and there are some false star spots present. In the star spot extraction results of the Top-Hat algorithm, there are a large number of false star spots in the regions with stray light distribution, which poses significant challenges for subsequent sky area identification and target recognition. From the last row of
Table 5, it is evident that the IEGI algorithm extracts the highest number of correct star spots and the lowest number of false star spots through multiple grayscale iterations and star spot extraction based on image entropy. It effectively extracts the target star spots in regions with stray light distribution.
From
Table 6, it can be visually observed that the photographed star image contains extensive background stray light with higher grayscale values compared to the true star image. This has led to some genuine star spots being submerged and unable to be accurately separated from the background. In the star spot extraction results of the max–mean filtering algorithm and the max–median filtering algorithm, only a small number of pixels have grayscale values, indicating a low number of extracted star spots. This is consistent with the analysis results in
Table 5. In the background stray light regions, the Top-Hat algorithm’s extraction results show a large number of pixels with higher grayscale values compared to the ground truth, indicating the presence of false star spots. From the last row of
Table 6, it can be observed that the IEGI algorithm exhibits the highest similarity with the grayscale histogram of the ground truth, effectively extracting the star spots in the target celestial region.
From
Figure 10, it can be quantitatively observed that the number of correctly extracted star spots by the max–mean and max–median filtering algorithms is notably lower compared to the Top-Hat and the IEGI algorithms under the three practical conditions depicted in
Figure 8. Among them, the IEGI algorithm extracted the highest number of correct star spots, with 93, 67, and 87, respectively. From
Figure 11, it can be quantitatively observed that the Top-Hat algorithm exhibits a substantially higher number of false star spots compared to the other three detection algorithms. The number of false star spots in the other three algorithms is relatively small. It can be seen from
Table 7 that only the results extracted by the IEGI algorithm indicate a high detection rate while maintaining a low error rate. From
Figure 10 and
Figure 11, and
Table 7, it can be concluded that although the max–mean filtering algorithm and the max–median filtering algorithm have a small number of false star spots in their extraction results, they extract fewer correct star spots. On the other hand, the Top-Hat algorithm, while extracting a number of correct star spots close to the IEGI algorithm, has a significant number of false star spots. Among the four algorithms, only the IEGI algorithm is able to achieve a large number of correctly extracted star spots while maintaining a small number of false star spots. This is consistent with the qualitative analysis results in
Table 5 and
Table 6.
In conclusion, for the three different practical conditions depicted in
Figure 8, the IEGI algorithm extracts the largest number of correct star spots with only a small number of false star spots. Under various real-life stray light conditions, the algorithm proposed in this paper demonstrates superior star spot detection performance compared to the other three detection algorithms, making it highly valuable for engineering applications.
8. Conclusions
To address issues such as the low star spot extraction rate and a high number of false star spots when the star tracker is affected by stray light during on-orbit operation, a grayscale iterative star spot extraction algorithm based on image entropy was proposed. Using this method, we first eliminated some background stray light through multiple iterations of grayscale transformations, enhancing the contrast of the star spot targets. Next, inner–outer star spot extraction templates were constructed, and then the extraction of star spots was carried out based on image entropy, which further suppressed the background clutter and noise. Based on the simulated and real star images, the algorithm was verified in numerical simulations and experiments. Compared to the max–mean and the max–median filtering algorithm, the detection rate of the IEGI algorithm increased by over 45%, and compared to the Top-Hat algorithm, the error rate decreased by over 50%. Compared to other star spot extraction algorithms presented in this paper, the proposed algorithm can achieve a higher number of correctly extracted star spots and a lower number of false star spots under different background noise interference conditions. Our work provides an alternative approach for star spot extraction, which should be further investigated in the future.