## 3 Method
### Reflection Removal
#### 3.3.1 Reflective Region Removal Method Based on Image Complementation
When solving the inverse problem for each layer (background layer and reflection layer), the relative displacement between the two frames before and after the image can be ignored, which is the running speed. Therefore, the expression for the objective function of image reflection removal can be simplified as  
\[ \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})\end{array}  \tag{17}\]  
Step 2: Design an improved reiterative weighted least squares (IRLS) method. Using IRLS to optimize unconstrained functions in the presence of 1-norm and 2-norm, where R, L, and A are set as the reflection layer component, background layer component, and AlphaMap of the final iteration. By linearizing the objective function data items and smoothing the function expression, a more natural removal effect is achieved to avoid image level mutations. Step 3: Add the compensation/penalty function \(U(x)=\lambda_{c}\text{min}(0,R)^{2}\). \(\lambda_{c}\) is the penalty coefficient. By utilizing compensation/penalty functions, the result of poor image reflection removal caused by other external factors (possible external factors such as vehicle bumps, wind speed, etc.) can be reduced in real-time. Step 4: Correct the R, L, and A parameters in step 2 and calculate \(V_{B}(t)\), \(V_{L}(t)\). Using Equation (17) and using the IRLS algorithm for motion mapping quadratic decomposition. \[F^{\prime}(x)_{\text{min}}=\left\|I(t)-\mu\times X(V_{L}(t))\times B(t)\times X (V_{R}(t))\times R(t)\right\|_{1}+\lambda_{3}\times(\left\|H_{R}\right\|_{1}+ \left\|H_{L}\right\|_{1}) \tag{18}\]  
where \(H_{R}\) and \(H_{L}\) are the gradient values of the reflection layer and the background layer, respectively. However, by the method for reflective region removal above, a more clearly separated background layer image cannot be obtained for reflective regions with different gradients. The separation results are shown in Figure 5. In order to solve this problem, this paper proposes a reflective region removal method based on improved image complementation and illumination compensation. 3.2 A Reflective Region Removal Method Based on the Combination of Improved Image Complementation and Illumination Compensation  
This paper includes the illumination compensation mechanism based on the reflection region removal method, which is based on image completion. Firstly, by selecting the video frame image according to the position of the reflection region to form the image sequence \(T^{*}=\left\{T_{1}^{*},T_{2}^{*},\dots,T_{n}^{*}\right\}\), this method adds illumination compensation to the reflection area in the reflection removal method based on image completion, so that the illumination intensity of the reflection region part in the image sequence \(T^{*}=\left\{T_{1}^{*},T_{2}^{*},\dots,T_{n}^{*}\right\}\) remains consistent and the reflection removal error is avoided. Secondly, the image sequence \(T^{\prime*}=\left\{T_{1}^{\prime*},T_{2}^{\prime*},\dots,T_{n}^{\prime*}\right\}\) is obtained by unifying the light of the reflective region, and the background layer of the reflective region part in image \(T_{j}^{\prime*}\) is complemented according to the method of image complementation (pixel overlay) to achieve no reflection in this background layer region. The image \(T_{j}^{\prime*}\) is differenced from image \(T_{j}^{\prime*}\) to obtain the reflective layer image \(L_{j}\) at time \(t_{j}\). Finally, the complete removal of the reflective region in the video is achieved by differencing the product with the image sequence \(T=\left\{T_{1},T_{2},\dots,T_{n}\right\}\). The specific reflection region removal steps are as follows:  
Step 1: Video framing. The black box camera line recording data are framed to obtain the video frame image sequence \(T=\left\{T_{1},T_{2},\dots,T_{n}\right\}\). Step 2: Reflection region \(M_{l}\) extraction.