# Nonuniform Background Correction for Wide-Field Surveillance Camera
## 3 Enhanced New Top-Hat Transform
The target is removed through Equation (3), and the structural elements containing the target energy are removed through Equation (4). Finally, we removed the targets and stars we were interested in and realized the preliminary estimation of the nonuniform background that needed to be eliminated. So the size of \(L_{c}\) should be larger than the space targets or stars we care about. Since the target we are interested in is within 20 \(\times\) 20 pixels. Therefore, \(L_{c}\) should be larger than 20 pixels. The smaller the \(L_{c}\), the stronger the background noise suppression. In order to achieve the best background suppression effect, \(L_{c}\) is 20 pixels in this paper. \[F_{2}=F_{1}\,\Theta\,L=\min\{F_{1}(i+m,j+n)\,-L(m,n)\,|(i+m),(j+n)\in D_{F_{1} },(m,n)\in D_{L}\,\} \tag{4}\]  
Figure 4: Used structural element in the proposed ENTHT method. where \(F_{2}\) is the image with the targets and stars removed. Then, the corrected surveillance image \(F_{3}\) is obtained by subtraction between the original image and the estimated background. Since the gray value of the background part we do not care about in \(F_{2}\) will become larger than the original image \(F\), we need to set the gray value of this part of image \(F_{3}\) to zero, as shown in Equation (5). \[F_{3}=F-\min(F,F_{2}) \tag{5}\]  
After the above steps, there will also be some residual noise, which remains in the image background. These noises appear as small isolated patches. In order to obtain a smoother background and achieve accurate segmentation of the space targets, we designed a noise structural element (NSE) N to eliminate the noise, as shown in Figure 5. NSE is a matrix with only 1 s. \(\Phi\) is defined as the current pixel region. \(\Delta\Phi\) represents the adjacent areas in the upper, lower, left, and right directions. The value of parameter \(\Delta S\) is one pixel. We define the denoising operation as follows:  
\[F_{4}(i,j)= \begin{cases}0,&\text{in case that }\Xi(i,j)=0\\ F_{3}(i,j),&\text{otherwise}\end{cases}  \tag{6}\]  
\[\Xi=\sum_{m,n}F_{3}(i-m,j-n)\times N(m,n)\big{|}(i-m,j-n)\in D_{F_{3}},(m,n) \in D_{N} \tag{7}\]  
where \(N\) represents the noise structural element (NSE), \(D_{N}\) represent the domain of \(N\). When \(\Xi(i,j)\) becomes 0 after Equation (5), we consider the area \(\Phi\) as noise. In order to save algorithm time, the current pixel region \(\Phi\) is defined, as shown in Equation (8). \[\Phi(i,j)=\{(i,j)\},\{(i,j),(i+1,j)\},\{(i,j),(i-1,j)\},\{(i,j),(i,j+1)\},or \{(i,j),(i,j-1)\} \tag{8}\]  
where \(\{(i,j)\}\) represents the current pixel, \(\{(i,j),(i+1,j)\}\) represents the current pixel and the right adjacent pixel, \(\{(i,j),(i-1,j)\}\) represents the current pixel and the left adjacent pixel, \(\{(i,j),(i,j+1)\}\) represents the current pixel and the lower adjacent pixel, and \(\{(i,j),(i,j-1)\}\) represents the current pixel and the upper adjacent pixel. Firstly, the denoising operation can properly eliminate the noise submerged in the nonuniform background. Secondly, it reduces the dependence of the noise suppression effect of the new top-hat transform on the selection of structural elements. It also reduces the sensitivity of weak targets to the selection of structural elements in the new top-hat transform and can better select more appropriate structural elements in order to retain  
Figure 5: Used noise structure element (NSE) in the proposed ENTHT method. the weak targets so as to realize the accurate segmentation of space targets in the space surveillance image. Figure 6 shows the experimental results of background correction for the ENTHT method proposed in this paper.