## 3 Method
### Reflection Removal
#### 3.3.1 Reflective Region Removal Method Based on Image Complementation
Firstly, image pre-processing is performed on the detection region \(G=\left\{G_{1},G_{2},\dots,G_{n}\right\}\) for ROI extraction and to improve the extraction accuracy of the reflection region. The brightness of the image \(T_{i}\) corresponding to the edge gradient difference \(D\) of the reflective region is less than the threshold \(D_{c}\), which is adjusted by the light compensation mechanism set in this paper to increase the edge gradient difference of the reflective region so that the reflective region in the image is better  
Figure 5: The results of an image complementation-based reflective region removal method. extracted. Finally, according to the principle of invariance of reflective region mapping under the same illumination conditions, the region matching of two frames is performed by an MSER algorithm in order to fit the shape uncertainty of the reflective region. The DBSCAN clustering algorithm is applied to cluster the acquired data points to determine the reflective region \(M_{l}\). Step 3: The number of images \(Z\) required for reflected area removal is calculated, and an image sequence \(T^{\prime}=\{T^{\prime}_{1},T^{\prime}_{2},\dots,T^{\prime}_{n}\}\) is constructed. The range of horizontal axis coordinates \([x_{\text{min}},x_{\text{max}}]\) corresponding to the pixels at the edge of the reflected area can be obtained through step 2. The number of image sheets \(Z\) required for reflected area removal is calculated according to Equation (19), where \(Z\) is an integer. The time \(t_{c}\) required for the distance of the reflected region from the edge of the image can be deduced from the camera running speed \(V_{c}\), i.e., according to \(t_{c}=\frac{V_{c}}{x_{\text{min}}}\) as the step length for selecting images in the image sequence \(T=\{T_{1},T_{2},\dots,T_{n}\}\) to form a brand new image sequence \(T^{\prime}=\{T^{\prime}_{1},T^{\prime}_{2},\dots,T^{\prime}_{n}\}\). \[Z=\left\lceil\frac{x_{\text{max}}-x_{\text{min}}}{x_{\text{min}}}\right\rceil \tag{19}\]  
Step 4: The objective function \(F(x)\) is established. The objective function is constructed by considering the form of gradient existence. We assume that the detected gradient conforms to the Gaussian distribution and that it satisfies the heavy-tailed distribution; we define the gradient influence factors \(W(R,L),\sum\limits_{t}\left\|H_{VR}(t)\right\|_{1}+\left\|H_{VL}(t)\right\|_{1}\), and \(\left\|H_{R}\right\|_{1}+\left\|H_{L}\right\|_{1}\), as well as the light compensation as shown in Equation (19). \(B(t)\) and \(R(t)\) are the corresponding background and reflection layers at moment \(t\), respectively, and \(\mu\) is the proportion of the area of the image occupied by the moving layer. \(\{V_{R}(t)\}\) and \(\{V_{L}(t)\}\) are the sets of layer movement velocities for the reflection and background layers, respectively. \(\sum\limits_{t}\left\|H_{VR}(t)\right\|_{1}+\left\|H_{VL}(t)\right\|_{1}\) is a sparsity operation on the gradients of the motion fields of the two layers, which minimizes the gradients. \(H_{VR}(t)\) and \(H_{VL}(t)\) are the gradient values of the moving velocity of the reflective layer and the background layer at moment \(t\), respectively. In order to unify the layers, the gradient constraint \(W(R,L)\) is added. \[ \begin{array}{l}F(x)=\sum\limits_{t}\left\|I(t)-\mu\times X(V_{L}(t))\times B (t)\times X(V_{R}(t))\times R(t)\right\|_{1}+\lambda_{1}\times W(R,L)+\lambda_ {2}\times(\left\|H_{R}\right\|_{1}+\left\|H_{L}\right\|_{1})\\ +\lambda_{3}\times\sum\limits_{t}\left\|H_{VR(t)}\right\|_{1}+\left\|H_{VL(t)} \right\|_{1}+b\times B_{g}(x,y)+c\times B_{f}(x,y)\end{array}  \tag{20}\]  
Step 5: Pixel replacement and \(F(x)\)-function decomposition. Firstly, through the image sequence \(T^{\prime}=\left\{T^{\prime}_{1},T^{\prime}_{2},\dots,T^{\prime}_{n}\right\}\), obtained in step 3, pixel replacement is performed for the duplicate parts in the adjacent frame images, and due to the different perspective and distance, the image points need to be multiplied by the perspective conversion matrix \(K\).