2. Related Work
In the past few decades, traffic accidents have become a significant factor leading to casualties and property loss. Therefore, research on how to prevent traffic accidents and ensure pedestrian safety has been a focus in the transportation field. Previous studies have focused on the relationship between vehicles. Liqin Huang et al. [
9] introduced a robust vehicle distance estimation method based on monocular vision, utilizing principles of object detection, segmentation, and geometric analysis for distance estimation. Ahmed Ali et al. [
10] proposed a real-time vehicle distance estimation method based on single-view geometry, utilizing geometric features of road lane markings and combining lane and vehicle detection modules to estimate the intersection ratio of the horizon and calculate the distance between vehicles and the road. Karthika K. et al. [
11] presented a method for preceding vehicle distance estimation based on monocular vision cameras and artificial neural networks, utilizing a YOLO object detector for vehicle detection and extracting input and output attributes from detected vehicle bounding boxes to estimate preceding vehicle distances. Deng-Yuan Huang et al. [
12] described a driving assistance system based on a single-lens video camera, providing drivers with assistance in vehicle detection and distance estimation on urban and suburban roads to improve driving safety. Giseok Kim et al. [
13] introduced a vision-based vehicle detection and inter-vehicle distance estimation algorithm for driving assistance systems, which combined multiple vehicle and Haar-like features as well as edge features to accurately detect vehicles and estimate distances between them in real-time scenarios. J. Han et al. [
14] presented a method for vehicle distance estimation using a monocular camera, utilizing detected lane information and a pinhole camera model to calculate the position, velocity, acceleration, and time-to-collision (TTC) of target vehicles. The above-mentioned articles have developed various methods and technologies to achieve distance estimation between vehicles in monocular vision, without considering the safety environment of surrounding pedestrians.
Safety recommendations based on distance estimation are a key step in improving traffic safety. Tabitha S. Combs et al. [
15] proposed that equipping vehicles with VLC, LiDAR, and radar devices could significantly reduce the likelihood of pedestrian fatalities, based on pedestrian fatality data from various states and the District of Columbia in the United States in 2015. Piotr Olszewski et al. [
16] conducted research on pedestrian–vehicle encounters in Warsaw and Wroclaw, based on MOBIS project data, to develop alternative safety indicators for pedestrian–vehicle encounters using parameters such as speed profiles of pedestrians and vehicles, minimum distances between participants, and deceleration during braking. They also proposed encounter classifications based on pedestrian–vehicle interaction characteristics and evaluated solutions to enhance pedestrian safety at crosswalks. Alexander Ganichev et al. [
17] aimed to address conflicts between vehicles and pedestrians and proposed a systemic approach to improve traffic safety. They considered evaluating conflicts between vehicles and pedestrians within the (P-V-R-TE) system as a promising method. This approach, based on objective analysis and assessment, aimed to reduce conflicts between vehicles and pedestrians through the systematic analysis and improvement of traffic management measures, thereby providing more reliable decision-making grounds to enhance traffic safety. Salvatore Cafiso et al. [
18] presented a method for measuring traffic conflicts based on the Pedestrian Risk Index (PRI) to assess the impact of new traffic calming devices on pedestrian crossing safety performance. Je-Seok Ham et al. [
19] proposed the CIPF model, a network for predicting pedestrian crossing intentions, aimed at improving the safety of autonomous vehicles with respect to pedestrians. This model, by integrating multiple input features of pedestrians and vehicles and utilizing recurrent neural networks and attention mechanisms, accurately predicted whether pedestrians would cross the road. These papers provide a series of safety recommendations such as deceleration and maintaining safe distances, based on rough estimations of pedestrian safety environments, combined with traffic rules and safety standards, to reduce the occurrence of traffic accidents and ensure pedestrian safety.
In summary, previous research has primarily focused on preventing vehicle-to-vehicle traffic accidents, target recognition algorithms, distance estimation, and safety recommendations. There has been no relevant research accurately measuring the distance between pedestrians and vehicles. Therefore, building upon these studies, this research proposes a target recognition method based on neural network models, integrating edge extraction using the Canny algorithm, utilizing the principle of similar triangles for distance estimation from a single image, and providing safety recommendations based on distance estimation. The aim is to reduce the occurrence of traffic accidents and ensure pedestrian safety.
4. Experiment
Based on the algorithm framework developed in this paper, we devised a pedestrian safety warning system to enhance the safety of pedestrians. The system captured real-time video streams through a camera with 1080p resolution and a frame rate of 30 fps and used the NVIDIA Jetson Xavier NX edge computing unit for data processing. The Jetson Xavier NX is equipped with a 6-core ARM CPU, a 384-core Volta GPU, 8 GB of memory, and 512 GB of SSD storage, offering powerful computing capabilities that enable real-time operation of the YOLOv5x object recognition model and high-precision distance estimation based on single image measurement and the principle of similar triangles.
This ensured that the system could accurately detect pedestrians and vehicles and provide corresponding safety warnings based on their location and distance. By processing and analyzing video data in real time, the system could issue timely alerts to remind drivers and pedestrians of potential safety risks, effectively reducing the occurrence of collision accidents and enhancing pedestrian safety.
The system obtained real-time video streams from the camera and processed each frame with the algorithm. A static scene from one of the frames was selected for the actual distance measurement to compare with the algorithm, as shown in
Figure 10.
The trained YOLOv5x model was applied to process each frame, detecting and recognizing pedestrians and vehicle targets within it. This enabled us to accurately locate and label the positions of pedestrians and vehicles in the image, as shown in
Figure 11.
Apply the trained YOLOv5x model to process each frame, detecting and recognizing pedestrians and vehicle targets within it. This enables us to accurately locate and label the positions of pedestrians and vehicles in the image, as shown in
Figure 12.
For each detected pedestrian and vehicle target, apply the Canny algorithm to extract their contours. This helps to more accurately determine the shapes and boundaries of pedestrians and vehicles. Determine the positions of the corner points to facilitate distance calculation later on, as shown in
Figure 13.
By utilizing the known height of the camera and employing the same principle of pixel ratio within the same plane, the pixel distance between the right edge corner point of the car and the left edge corner point of the pedestrian was calculated. Then, the actual distance based on the formula was calculated. The measured actual distance was 85 cm, while the distance calculated by the algorithm was 84.1489 cm, resulting in a 1% error. The algorithm’s calculation was relatively accurate. Therefore, safety recommendations were proposed based on relevant traffic rules, and warnings were issued to pedestrians.
To further validate the accuracy and reliability of the algorithm, we conducted additional experiments. These experiments involved different scenarios, angles, and distances, and comparing the results with actual measurements.
First, we designed experiments to investigate the interaction between individual pedestrians and vehicles at different distances between the camera, pedestrians, and vehicles. The experimental setup was as follows:
- (1)
The camera was mounted on a streetlight at a height of 3 m.
- (2)
The pedestrian stood at three distances from the camera: 3 m, 7 m, and 14 m along the roadside.
- (3)
The lateral distance between the vehicle and the pedestrian was either 1.04 m or 2.20 m.
The schematic diagram of the system is shown in
Figure 14.
The experimental results indicated that the algorithm accurately calculated the distance between vehicles and pedestrians under different camera distances and pedestrian–vehicle distances. The specific data are shown in the
Table 1:
Next, considering different pedestrian behaviors, we designed experiments to explore the relationship between pedestrians pushing bicycles and vehicles, with the experimental setup identical to the previous one. The schematic diagram of the system is shown in
Figure 15.
The experimental results indicated that the algorithm could also accurately measure distances when pedestrians were pushing bicycles. The specific data are shown in the
Table 2:
Next, considering the pedestrian cycling status, we designed experiments to explore the relationship between pedestrians riding bicycles and vehicles, with the experimental setup identical to the previous one. The schematic diagram of the system is shown in
Figure 16.
The experimental results indicated that the algorithm could also measure distances accurately when pedestrians were riding bicycles. The specific data are shown in the
Table 3:
Considering that pedestrians often cross roads together, we designed experiments to measure the distance between the nearest pedestrian and the vehicle when multiple pedestrians were walking together. The experimental setup was the same as before. The schematic diagram of the system is shown in
Figure 17.
The experimental results indicated that the algorithm could also measure distances accurately when multiple pedestrians were walking together. The specific data are shown in the
Table 4:
4.1. Validation of Overall System Model Accuracy
To verify the accuracy of the proposed vehicle distance detection and warning scheme, we compared it with the measurement data from the mid360 LiDAR. The mid360 LiDAR is a commonly used high-precision distance measurement device that can provide reliable ranging data. By comparing the measurement results of our system with those of the mid360 LiDAR under the same test conditions, we could effectively evaluate the accuracy and reliability of our method, as shown in
Table 5:
The experimental results indicated that our method provided the most optimal distance estimation results across different ranges. Compared to the mid360 LiDAR, within a range of 10 m, the average error of our distance estimation method was reduced by up to 0.077 m. Even at distances beyond 10 m, the average error of our distance estimation results was guaranteed to be around 0.017 m. Compared to the mid360 LiDAR, the average error was significantly reduced, achieving the optimal result, and the accuracy of the system’s distance estimation was improved. Moreover, the maximum deviation of the average error across different ranges was about 0.018 m. Compared to the mid360 LiDAR, the deviation between the system’s estimation results at different distances was reduced, making the overall distance estimation system more stable and robust.
This demonstrates that the scheme has the potential to become an important tool for improving traffic safety, providing precise distance information for intelligent connected vehicles and autonomous driving vehicles, and ultimately contributing to the realization of holographic intersection vehicle–road collaborative driving.
4.2. Assessment of System’s Adaptability to Multiple Scenarios
In the experiments, only the system’s performance within residential areas was considered, neglecting its application in other scenarios. Therefore, the system was deployed in urban and rural streets for testing.
Rural roads typically have lower traffic density and wider road surfaces, but the road surfaces may be uneven, which may result in a larger field of view and uneven lighting conditions. The frequency of pedestrians, bicycles, and agricultural vehicles is relatively low, but occasional emergencies may occur, such as animals crossing the road [
22], as shown in
Figure 18.
To address these challenges and enhance the accuracy of the system, we integrated LiDAR as an auxiliary measurement tool in the system to better handle uneven road surfaces and emergencies [
23]. This improved the system’s accuracy and its ability to respond to unexpected situations.
Urban roads have high traffic density and complex traffic environments, including various factors such as vehicles, pedestrians, bicycles, and traffic signals. There are significant variations in lighting conditions and road conditions, and congestion is often present, as shown in
Figure 19.
We can see that urban roads are very busy, and the road conditions change frequently, so the system’s low-latency feature (overall latency controlled within 50 ms) ensures that safety warnings can be issued in real time in the busy urban road environment. In addition, by setting the camera’s sensitivity as a variable parameter and adjusting it in real time according to lighting changes, the system can handle data under different lighting conditions and maintain a high level of detection accuracy.
4.3. Evaluation of Vehicular Network Communication Performance
Implementing and deploying vehicular network architectures in real-world scenarios is challenging and costly. As a result, most research in the field of vehicular networks relies on simulation-based evaluations. In this study, we selected VanetMobiSim as the traffic simulator because it is open-source and has been validated against commercial simulators. VanetMobiSim supports an intelligent DriverModel with intersection management, generating realistic vehicle mobility models.
The experiments were conducted in two different speed environments to evaluate the system’s performance under varying speeds.
The experimental scenario design was as follows:
- (1)
Road environment selection:
Environment A: low-speed mixed traffic, with vehicle speeds below 30 km/h, and vehicles present at all intersections.
Environment B: medium-speed mixed traffic, with vehicle speeds between 30–60 km/h, and vehicles present at all intersections.
- (2)
Test vehicles and equipment:
Eight test vehicles were selected in each environment, each equipped with an onboard unit (OBU). Two Roadside Units (RSU) were installed at key points along the experimental route. During the experiment, IEEE 802.11p technology was used for data transmission between vehicles and RSUs.
- (3)
Test scenario:
Vehicles traveled from one end of an intersection to the other, passing through the coverage areas of two RSUs. During this process, the RSUs transmitted safety warnings to the vehicles, as shown in
Figure 20, to test the system’s seamless handover capability.
The experimental data are shown in
Table 6.
The experimental data showed that the system maintained low latency across different environments and test scenarios, with an average latency of only 10–15 ms, ensuring real-time performance. The false positive rate and false negative rate were both below 2% and 1%, respectively, indicating the system’s accuracy and reliability in identifying potential hazards. The successful handover rate exceeded 97%, effectively achieving seamless transitions between RSUs and ensuring continuous communication. The safety warning accuracy rate was above 97%, allowing the system to provide precise safety alerts and significantly enhancing traffic safety.
4.4. Assessment of Overall System Computational Complexity
In this study, we proposed an automated vehicle distance detection and warning system based on roadside cameras and edge computing units, aimed at achieving vehicle–road collaboration in smart transportation. The core computational complexity analysis of the system is as follows:
Roadside cameras capture intersection videos in real time at 1080p resolution and 30 fps frame rate. Although the hardware performance has a relatively minor impact on the overall computational complexity of the system, it ensures the quality and continuity of data collection. The edge computing unit uses NVIDIA Jetson Xavier NX, which has powerful computing capabilities, capable of processing high-definition video streams in real time and running complex deep learning models. The YOLOv5x model, as the algorithm for object recognition, requires approximately 10 ms for each forward propagation, matching the frame rate of the camera, ensuring the real-time processing. The distance estimation algorithm based on single-image measurement and the principle of similar triangles has a computational complexity of O(1), capable of quickly estimating the distance in constant time.
Vehicular network communication uses IEEE 802.11p as the communication protocol, a wireless standard specifically designed for vehicular networks that provides low-latency and reliable communication in high-speed mobility environments. The protocol operates in the 5.9 GHz frequency band, supporting stable communication for vehicles traveling at high speeds. Through optimized transmission mechanisms, the protocol reduces communication latency in high-density traffic scenarios, ensuring efficient real-time data transmission.
The overall system latency, from video capture to the output of warning information, is controlled within 50 ms, meeting the real-time requirements. The hardware configuration of the edge computing unit, including a 6-core ARM CPU, 384-core Volta GPU, 8 GB of memory, and 512 GB of SSD storage, provides ample computing resources for the system. It not only supports the efficient operation of the YOLOv5x model but also meets other data processing and storage needs.
In summary, our system effectively controls computational complexity while maintaining high precision and real-time performance by optimizing algorithms and hardware configurations. This provides a solid technical foundation for achieving vehicle–road collaboration in holographic intersections and is expected to become an important tool in the field of traffic safety.