# Grayscale Iterative Star Spot Extraction Algorithm Based on Image Entropy
## 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 adaptabilityin 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.