# Dim Staring Debris Targets Detection Method with Dense Long Trailing Star
## 2 Semi-Occluded Object Detection Algorithm Based on FCN
### Trailing Aggregation Based on Rectangular Fitting  
Due to noise interference and low SNR condition, stellar tails often appear in an \"unstable\" state in images. These states will seriously interfere with the image processing, mainly including three cases (as shown in Figure 3): The middle part of the trailing tail is broken, \"Crack\"; The end of the trailing tail is attached to other trailing tails, \"Adhesion\"; The trailing end diverges and becomes difficult to determine the edge, \"Divergence\". Traditional image processing methods can hardly solve these three problems. In order to ensure the accuracy of subsequent detection, the influence of the above problems must be eliminated first. Considering that both the angle and length of the trailing star can be predicted, the simplified rectangular fitting method is adopted here to conduct a contour search for the trailing target and finally form the edge rectangle box with the minimum error. Figure 1: Superposition of three consecutive images (red: 1 th; green: 2 nd; blue: 3 rd). Figure 2: Gray amplitude comparison between local target and star (blue: low grayscale; yellow: high grayscale). The main rectangle contour fitting algorithm includes the following four steps:  
Step 1 (contrast segmentation calculation): Denote \(I_{N}\) as the image, where \(N\) is the size. Use the \(3\times 3\) and \(7\times 7\) square operator, and denote \(I_{d}\) as the contrast of \(I_{N}\), where \(T_{d}\) is the threshold. \(x,y\in[0,N-1]\) and \(x,y\in Z^{+}\), the formula for calculating the contrast is as follows:  
\[I_{d}(x,y)=\left\{1,\frac{\sum\limits_{i=-1}^{1}\sum\limits_{j=-1}^{1}I_{N}(x+ i_{j}y+i)}{\sum\limits_{i=-3}^{3}\sum\limits_{j=-3}^{3}I_{N}(x+i_{j}y+j)-\sum \limits_{i=-1}^{1}\sum\limits_{j=-1}^{1}I_{N}(x+i_{j}y+j)}\geq T_{d}.\right. \tag{1}\]  
Step 2 (binary labeling): Traditional binary annotation calculation is performed on \(I_{d}\) to obtain \(M\) target sets:  
\[I_{b}(m)=\left[(x_{(0,m)},y_{(0,m)}),(x_{(1,m)},y_{(1,m)}),\cdots,(x_{(K_{m}-1,m)},y_{(K_{m}-1,m)})\right] \tag{2}\]  
where, \(m\) is denoted as the \(m\)-th target, and \(m\in[0,M-1]\), \(m\in Z^{+};K_{m}\) is the valid pixel number of the labeled target; \((x_{(k_{m},m)},y_{(k_{m},m)})\) represents the coordinates of the \(k_{m}\) pixel of the \(m\)-th labeled target, and \(k_{m}\in[0,K_{m}-1]\), \(k_{m}\in Z^{+}\). Step 3 (trailing rectangle generation): For any marked target \(I_{b}(m)\), the position coordinates of its centroid \(I_{c}(m)\) are obtained as follows:  
\[I_{c}(m)=[\frac{\sum\limits_{k_{m}=0}^{K_{m}-1}x_{(k_{m},m)}}{K_{m}},\frac{ \sum\limits_{k_{m}=0}^{K_{m}-1}y_{(k_{m},m)}}{K_{m}}] \tag{3}\]  
The reason why gray value weighting is not used in Equation (3) is that the target width is only three to four pixels, which is greatly disturbed by noise, and the weighting will cause more calculation errors. The center of mass of the \(m\)-th marked target is taken as any point in the rectangle, and the trailing angle \(\pm\theta\) of the star is taken as the search direction to conduct the fitting rectangular box search. The fitting process is shown in Figure 4. \(W_{f}=4\), \(L_{f}=26\). The number of rectangles is, at most, \(4W_{f}L_{f}=416\). The cyan dot is the centroid of the binary-labeled region. When the rotation angle is \(\theta\), the rectangle with \(I_{c}(m)\) as the lower left point is shown in Figure 5. Through any point in the rectangle, the coordinate of the lower left corner of the matrix can be calculated, and then the coordinate of the four corners of the rectangle can be obtained so as to obtain the generating rectangle set \(R(m)\) of the \(m\)-th labeled target. \(R(m,q)\) denotes the set of rectangles with width and length \(W_{f}\) and \(Lf\) at any point with \(I_{c}(m)\), and \(q\) denotes the \(q\)-th rectangle. Figure 3: Problems in stellar trailing detection.