## 3 Proposed Methods
### Stereo Taillight Matching
#### 3.2.2 Features for Stereo Taillight Matching  
Many features can affect the matching probability between the two arbitrary taillights. However, we have to choose the features that not only imply the similarity between the two matched taillights but also highlight the difference between the two unmatched taillights to the maximum possible extent. Especially, one needs to be aware of the case wherein many taillights have the same appearance, which might cause ambiguity for the matching task. To satisfy these criteria, we propose five features for constructing the feature vector \(matchVec\) when considering the two taillights (\(L_{i}\), \(R_{j}\)): horizontal position ratio (HPR), vertical position ratio (VPR), width ratio (WR), height ratio (HR), and normalized cross-correlation (NCC). The first two features consider spatial correlation, whereas the last three features look for the similarity in the appearance of the two taillights. These features are calculated using the information of the detected taillight region, as illustrated in Figures 16 and 17. Figure 15: Stereo taillight matching procedure. Figure 16: Pixel coordinates of the taillight in: (a) left image; (b) right image. The explanation of each feature is presented as below:  
1. **HPR**: Implies the horizontal coordinates difference between the two taillights \(L_{i}\) and \(R_{j}\). Let us assume the horizontal coordinates of \(L_{i}\) and \(R_{j}\) as \(x_{i}^{L}\) and \(x_{j}^{R}\), respectively. Initially, both \(x_{i}^{L}\) and \(x_{j}^{R}\) are normalized as \(\overline{x_{i}^{L}}\) and \(\overline{x_{j}^{R}}\) by dividing with the width of the corresponding image, which is \(W_{L}\) and \(W_{R}\): \[ \begin{cases}\overline{x_{i}^{L}}=\dfrac{x_{i}^{L}}{W_{L}}\\ \overline{x_{j}^{R}}=\dfrac{x_{j}^{R}}{W_{R}}\end{cases} ,\] (14) After obtaining \(\overline{x_{i}^{L}}\) and \(\overline{x_{j}^{R}}\), HPR is determined as  
Figure 17: Width and height of the taillight in: (**a**) left image; (**b**) right image. \[HPR= \begin{cases}\dfrac{\textbf{min}(\overline{x_{i}^{L}},\overline{x_{j}^{R}})}{ \textbf{max}(\overline{x_{i}^{L}},\overline{x_{j}^{R}})},&\text{if }\ \overline{x_{i}^{L}}\leq\overline{x_{j}^{R}}\\ -\dfrac{\textbf{min}(\overline{x_{i}^{L}},\overline{x_{j}^{R}})}{\textbf{max}( \overline{x_{i}^{L}},\overline{x_{j}^{R}})},&\text{otherwise}\end{cases} ,\] (15) The value of HPR lies within the range \([-1,\,1]\). The negative value implies that the horizontal coordinates of \(R_{j}\) are smaller than those of \(L_{i}\), and vice versa. As illustrated in Figure 2, the horizontal coordinates (Ox-axis coordinate) of the object in the left image must be larger than those in the right image; therefore, the HPR of the two matched taillights must be greater than 0. Otherwise, we can conclude that the two taillights do not match each other. 2. **VPR**: To consider the vertical coordinates difference between the two taillights \(L_{i}\) and \(R_{j}\). For calculating VPR, first, the normalized values \(\overline{y_{i}^{L}}\) and \(\overline{y_{j}^{R}}\) of \(L_{i}\) and \(R_{j}\) are calculated as below: \[ \begin{cases}\overline{y_{i}^{L}}=\dfrac{y_{i}^{L}}{H_{L}}\\ \overline{y_{j}^{R}}=\dfrac{y_{j}^{R}}{H_{R}}\end{cases} ,\] (16) where \(y_{i}^{L}\) and \(y_{j}^{R}\) are the vertical coordinates of \(L_{i}\) and \(R_{j}\), and \(H_{L}\) and \(H_{R}\) are the heights of the left image \(I_{L}\) and the right image \(I_{R}\), respectively. Subsequently, VPR is given by \[VPR=\dfrac{\textbf{min}(\overline{y_{i}^{L}},\overline{y_{j}^{R}})}{\textbf{ max}(\overline{y_{i}^{L}},\overline{y_{j}^{R}})},\] (17) The value of VPR is within the range \([0,\,1]\). As the vertical coordinates of one taillight in the image partly represents the \"depth\" between the taillight and the camera in a real scenario. When the two taillights are farther from each other, the value of VPR is higher, which makes it more likely that the two taillights do not match, and vice versa.