## 3 Method
### Reflection Removal
#### 3.3.1 Reflective Region Removal Method Based on Image Complementation  
In this paper, we need to perform reflection removal on video data, which belongs to the category of dynamic reflection removal. We first need to split the video into frames and convert the video into image sequences by performing optical flow processing on two of the frames in image sequence \(T=\{T_{1},T_{2},\ldots,T_{n}\}\), while identifying and extracting the reflection regions present in image sequence \(T=\{T_{1},T_{2},\ldots,T_{n}\}\), according to the reflection region extraction algorithm in Section 3.2. And then we need to update the reflected regions according to the replacement image pixel method. The part of the area blocked by the reflected area, where the vehicle motion and camera parameters (vehicle speed/camera motion speed \(V_{c}\), field of view \(\delta\), camera height \(h\), etc.) are, can be preset according to the test requirements. First, the image objective function is established based on the video frame image sequence \(T=\{T_{1},T_{2},\ldots,T_{n}\}\) as  
\[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} \tag{14}\]  
where \(\{V_{R}(t)\}\) and \(\{V_{L}(t)\}\) are the set of layer movement velocities for the reflection and background layers, respectively. In order to reduce the reflection removal accuracy degradation due to image blurring, prior picture constraints are added on the decomposed image and layer motion fields. The natural image gradient in this paper conforms to the heavy tailed distribution \(\left\|H_{R}\right\|_{1}+\left\|H_{L}\right\|_{1}\), and it is assumed that the detected gradient conforms to the Gaussian distribution. Then, in order to enable the complete separation of the background layer from the reflection layer, we simplify the construction of the image in the presence of the reflection region by assuming that the objects in the background layer do not duplicate the objects in the reflection layer; i.e., the objects corresponding to strong gradients exist in only one of the two layers and cannot exist in both layers. To adopt this assumed way of object gradient existence, the method is defined as  
\[W(R,L)=\sum\limits_{t}\left\|H_{R}(t)\right\|^{2}+\left\|H_{L}(t)\right\|^{2} \tag{15}\]  
After that, a sparsity operation is performed on the gradient of the motion field of the two layers, i.e., \(\sum\limits_{t}\left\|H_{VR}(t)\right\|_{1}+\left\|H_{VL}(t)\right\|_{1}\), so that the gradient is minimized. By taking all the above factors into account, the reflection removal image objective function constructed in this paper is shown in Equation (16). \[ \begin{array}{l}F(x)_{\min}=\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} \end{array}  \tag{16}\]  
The gradients of the two selected adjacent video frame images are calculated and the gradient dilution is performed. The latter motion image \(I_{i+1}\) is pixel overlapped (replaced) with the former motion image \(I_{i}\) using the pixel replacement method, which makes up for the background layer partially covered by the reflective region to obtain the updated video frame image \(I_{i}^{\prime}\). Then, the updated video frame image \(I_{i}^{\prime}\) is subjected to an image subtraction algorithm with image \(I_{i}\) to obtain the partially complemented motion image gradient \(\widetilde{R}_{i}(t)\). We calculate the average value of its regional gradient and subtract this average gradient value \(\overline{H}_{i}(t)\) from the extracted motion map of the reflected region to obtain the motion gradient map \(I_{i}^{\prime\prime}\) after the reflected region is removed. Finally, the alternating gradient descent method solves for \(R(t)\) and \(L(t)\). The solution steps are as follows:  
Step 1: Simplify target functionality.