# Mono Camera-Based Optical Vehicular Communication for an Advanced Driver Assistance System
## 3 Proposed Scheme
### Receiver
#### 3.3.3 Road Curvature Estimation  
Using the actual vehicle size along with the determined direction obtained using OCC, the amount of road curvature was determined from the rear LED shapes of the FWV. The rear LED shapes of the FWV projected on the IS of the FLV in different directions are shown in Figure 6. When the FWV turned left with respect to the FLV, the distance between the two rear LEDs and the size of the right rear LED in the IS appeared to decrease, as shown in Figure 6a. The larger the road curvature, the smaller the size of the right rear LED. The projected image of the left LED experienced a similar situation when the FWV turned right, as shown in Figure 6c. When the FWV moved straight with respect to the FLV, the size of the both LEDs appeared to be same which is depicted in Figure 6b. The procedure for determining the road curvature is presented in Figure 7.  
A CNN with two hidden layers was used to classify the images at different angular conditions. At first, the NN was trained with 5000 images with their corresponding road curvature angles. The dimensions of the input and output vectors were 5000 \(\times\) 6 and 5000 \(\times\) 1, respectively, i.e., the dimension of the dataset was 5000 \(\times\) 7. Numerous light sources can exist in an image, including several backlights of on-road and off-road vehicles. If all pixels were given as input to the NN, the time complexity of the network would be enormously high. Therefore, the RoI was detected, and the interfering light sources were removed. Next, each pair of vehicular taillights was extracted as individual warped images. Then, a 4 \(\times\) 4 convolutional filter was utilized to extract the features, whereas max pooling with a 2 \(\times\) 2 filter further reduced the size of the warped images, preserving all features. This pooled feature map was flattened into one column, which was fed as the input to the NN.  
Figure 6: Change of rear LED shapes when the forwarding vehicle (**a**) turns left, (**b**) moves straight, and (**c**) turns right.  
Figure 7: Flowchart of detection and measurement of road bending angle from LED shapes.  
In this work, the non-linear softmax function was used, as the most attention was paid to the convergence efficiency. As a result, the penalty was imposed on the classification accuracy of the training data rather than the discriminative power of the learned bending angle representations. Thus, the filter weights were updated through the backpropagation mechanism to set the optimal filter value for testing purposes. The images were labeled with the estimated bending angle, and the mean square error (MSE) was calculated in the testing step.  
The road curvature could also be estimated trigonometrically. First, the coordinates of the LEDs were taken from the warped images, as mentioned above. Second, the distance per unit pixel was calculated with the prior knowledge of the distance between the rear LED pair obtained using OCC. When the FWV entered a curve, its direction was determined from the dissimilar shapes of the rear LED pair, and it seemed that the distance between the LEDs shrunk even though it actually remained constant. Third, the apparent distance between the LEDs was estimated with the previously calculated distance per pixel. Finally, by analyzing the hypothetical triangle formed, as shown in Figure 8a,b, the bending angle was calculated using the cosine function as follows  
\[\textit{Bending angle},\ \theta=\cos^{-1}\left(\frac{\textit{base}}{\textit{ hypotenuse}}\right), \tag{15}\]  
\[\theta=\cos^{-1}\left(\begin{array}{c}\textit{apparent dist. between two LEDs}\\ \textit{actual distance between two LEDs}\end{array}\right). \tag{16}\]  
This process was valid until the LEDs did not overlap in the IS.