## 3 Proposed Method
### Refinement of Camera Calibration Using Lane Detection  
Rearview cameras use fisheye lenses to capture a wide field of view. Owing to the significant distortion caused by fisheye lenses, a distortion correction method was first applied to calibrate the camera. Distortion in fisheye lenses is characterized by barrel distortion. Therefore, the proposed distortion correction method was implemented using Equation (4) [27,28]. \[ \begin{split} x_{d}&=x_{u}(1+k_{1}r^{2}+k_{2}r^{4}+ k_{3}r^{6})\\ y_{d}&=y_{u}(1+k_{1}r^{2}+k_{2}r^{4}+k_{3}r^{6}) \\ r^{2}&=x_{u}^{2}+y_{u}^{2}\end{split}  \tag{4}\]  
where \(x_{d}\) and \(y_{d}\) represent the \(x\) and \(y\) coordinates in the distorted image, respectively, and \(x_{u}\) and \(y_{u}\) represent the coordinates in the undistorted image, respectively. \(k_{1}\), \(k_{2}\) and \(k_{3}\) are distortion coefficients. Figure 5 shows the distortion correction results for the fisheye lens obtained using Equation (4). Figure 5a presents the distorted image, whereas Figure 5b displays the result after distortion correction. The lane markings, which appear as curves in Figure 5a, are represented as straight lines in Figure 5b following the correction. A perspective matrix is used to measure the distance from a camera. However, vehicle vibrations during driving, which are influenced by road surface conditions, complicate accurate distance measurements. These vibrations alter the perspective matrix, affecting the reliability of distance calculations. Figure 6 illustrates the variation in the height of an object in the image as a result of vehicle vibrations; the height of an obstacle fluctuates between images captured eight frames apart. As illustrated in the right section of Figure 6, the vehicle exhibits vertical movement due to road irregularities, whereas the left section of Figure 6 demonstrates that vehicles at the same distance appear to have varying heights. The red line in Figure 6 indicates a height of 182 pixels, underscoring the discrepancies in the height of the vehicle. Figure 4: (a) Lane-fitting result and (b) lane-tracking range determination result. As shown in Figure 6, the height differences led to errors in calculating the distance to the obstacles. This resulting error affects the accuracy of measuring the direction and relative distance for object tracking, ultimately hindering the accurate determination of the collision risk. To address these issues and reflect changes in the perspective matrix, the proposed method utilizes the lane detection results. The vanishing point can be extracted using the lane detection results. The vanishing point refers to the location where two parallel lines in three-dimensional space converge into a two-dimensional image. Figure 7 illustrates the results of extracting the vanishing point formed by the intersection of the two lanes; the vanishing point is located on the horizon. Figure 7a shows the vanishing point result with the centerline image, and Figure 7b shows the result with the center-letter image. The perspective matrix was adjusted using the extracted vanishing points. Equation (5) employs the results from the vanishing point detection operation to compute the effects of the vehicle's vertical movement while driving. The proposed method imposes a limitation of a maximum movement of \(\pm 30\) pixels to exclude exceptional situations, such as speed bumps, where the vanishing point moves significantly. \[S_{d}=O_{y}-V_{y} \tag{5}\]  
Figure 5: Fisheye lens undistortion result: (a) fisheye lens image and (b) undistorted image. Figure 6: Comparison of object height with vehicle vibrations. Figure 7: (a) Vanishing point detection result with centerline and (b) vanishing point detection result with center letter. where \(O_{y}\) represents the vanishing point coordinate measured when the vehicle is stationary and \(V_{y}\) denotes the modified vanishing point coordinate. \(S_{d}\) represents the difference in distance moved.