## 3 Proposed Method
### Lane Detection  
The proposed blind-spot detection method and lane change assistance system leverage lane detection results to define the warning area. In this approach, the positions of obstacles are assessed relative to the detected lanes, and warnings are issued for obstacles located in adjacent lanes. To enhance the accuracy of the relative speed and distance estimations, lane detection results were used to correct for vertical vibrations caused by vehicle movement. By identifying the vanishing point through lane detection, the vertical vibrations of the vehicle can be adjusted to improve the system's precision further [18; 19].  
As illustrated in Figure 2, the proposed method performs edge detection once an input image is received. Initially, the color image is converted to grayscale for edge detection. The Sobel edge detection method was applied in the vertical direction because the lane markings were oriented vertically. Equation (1) represents Sobel edge detection [20; 21].  
\[E(u,v)=\sum_{v=1}^{h-1}\sum_{u=1}^{w-1} (I(u-1,v-1)+2I(u-1,v)+I(u-1,v+1))\] \[-(I(u+1,v-1)+2I(u+1,v)+I(u+1,v+1)) \tag{1}\]  
where \(E\) represents the edge detection result, \(u\) and \(v\) denote the image coordinates, \(I\) is the input image, \(h\) is the height of the input image, and \(w\) is the width of the input image.  
Figure 3a illustrates the edge detection results. As shown Figure 3a, the lane-marking edges are composed of both positive and negative edges. Using the characteristics of lane markings, candidate lane markings are extracted by identifying edge pairs in which a positive edge is followed by a negative edge [22]. For each edge pair, a positive edge appears first, followed by a negative edge, based on the image coordinates. Figure 3b shows the results of using edge pairs. The negative edge was retained for the left-lane marking to extract the inner edge relative to the ego lane, whereas the positive edge was retained for the right-lane marking.  
The lane marking area settings utilize suboptimal tracking results. Lane markings were tracked using a Kalman filter [23; 24; 25]. The area was set based on the tracking results at a specific width, derived from the previous lane detection operation. Equation (2) illustrates the method used to set the suboptimal area.  
\[W_{d}=(d_{c}+d_{Kp})+C_{d} \tag{2}\]  
Figure 3: (a) Edge detection result and (b) edge pairing result.  
Figure 2: Block diagram for lane detection using rearview camera.  
where \(d_{C}\) is the offset of the lane-marking model in the current frame, \(d_{Kp}\) is the offset of the Kalman prediction result, and \(C_{d}\) is a constant value in the detection range.  
Lane fitting was performed using third-order polynomial fitting. Equation (3) represents the formula used for suboptimal fitting [19,26].  
\[\begin{split} f_{L}(x)&=a_{L}\cdot x^{3}+b_{L} \cdot x^{2}+c_{L}\cdot x+d_{L}\\ f_{R}(x)&=a_{R}\cdot x^{3}+b_{R}\cdot x^{2}+c_{R} \cdot x+d_{R}\end{split} \tag{3}\]  
where \(a_{L}\) and \(a_{R}\) represent the curvature rates, \(b_{L}\) and \(b_{R}\) are the curvatures, \(c_{L}\) and \(c_{R}\) are the heading angles, and \(d_{L}\) and \(d_{R}\) are the offsets of the left and right lanes, respectively.  
Figure 4a shows the results of the lane fitting. Figure 4b shows the results of the lane-tracking range determination.