YOLO real time detects and reminds the driver to keep distance — with Asus ROG FLOW Z13 GZ301VV

Czxdas
6 min readJun 6, 2023

--

At present, electric vehicles or new cars, whether it is Wei Xiaoli (NIO, Xiaopeng, Ideal, BYD) on the other side, or new cars in Europe and the United States, more or less have related applications to protect drivers, such as reducing the speed of the vehicle, moving the body, and so on.

To make these applications, the first thing to establish is that the machine must learn to detect objects, how to improve the effect with the main expression function, reduce the value of the loss function, what activation function and approximation function to use, and so on. But these need time and patience; if you want to step into machine learning, you can first do some applications to experience, and then optimize and create machine learning modules.

Here is an application using YOLO detection module to remind drivers to keep a safe distance between cars. (Coding in Python) The following uses Asus ROG Flow Z13 GZ301VV to test the conditions of poor weather and low light on the actual road:

In other situations, there are many cars at night, and the same machine is used to simulate whether the driver can be reminded to keep the distance between cars:

There are advantages and disadvantages, which will be described later.

Using Yolo to do real-time detection experiments, the purpose of the experiment is to remind users to keep a distance in traffic.

The following situation:
1. Because I changed to an electric locomotive, I don’t know why the sound of the new car is much lower than that of the old car. After operating for a while, I feel like I am falling asleep on the MRT.
2. Cycling wants to see the environment, find shops, find addresses, but cannot focus 100% on the front; turn your head to the side and back to talk to a third person, etc.
3. When driving while looking down to pick up something, or want to press the phone when it rings, turn around and talk to the child being carried, etc.

Next, the flow content of the application is described.

First here (Link) Refer to improve the use of YOLO
Then the way to judge is as follows:

Yolo detects and reminds the driver to keep distance in real time

Turn on the camera, capture real-time images, and send them to the YOLO module for judgment.
In the purple decision-making block, “detect object Is in Range of detecting”, it will judge whether the object meets the conditions to be detected. There will be two linear equations for the detected conditions. If both are in the following blocks of this linear equation, That is to say, it meets the requirements and is detected, and is immediately marked with a frame color.

Dynamically set two linear equations, the green line on the left and the blue line on the right in the figure below, the linear equation “ax+b = y”. The so-called dynamic is to adjust the parameters according to the lens conditions, and automatically calculate the individual "a" and "b" values of the two lines for subsequent calculation and judgment。

Cars coming from the two sides usually do not cross these two lines. Even if they do, the proportion in the line is too small to meet the detection requirements;

If the car on the left goes farther and faster, the area will become smaller and smaller, which is relatively safer for us.

Next, explain the red decision-making block in the flow chart, “Whether the car object in this screen is a car object in the previous round of screen?”, to determine whether the current object also exists in the previous round of screen and is detected, yes If it is, save the object of this car; no matter whether it is or not, it must be sent to the next green decision block.

The following shows the judgment of the same object, provided that each frame of the captured screen is continuous. Red represents the object of the next frame, and blue represents the original object.

Next is the green decision-making block in the flow chart, “Whether the vehicle object is within the dangerous vehicle distance and is closer to you than the previous vehicle object?” If the dangerous vehicle distance is getting closer, it will be marked for prompting.

How to judge that the vehicle objects in the dangerous area are getting closer to you? The calculated area can be achieved. If the visual area of the object is getting larger and larger, it also means that the object is getting closer to itself physically.

The detailed process still needs to be based on the flow chart above.
Finally, if every object on the screen has been judged, immediately take real-time images from the camera and do a new iteration process.

Therefore, the assistance of high-speed computing devices is very much needed. It just so happens that ASUS’s gaming tablet can also meet this demand. The model is Asus ROG Flow Z13 GZ301VV. The link below shows that computing requires heat dissipation. This gaming tablet is cleverly designed with air outlets facing upwards, so you can put high-speed computing chips and GPUs into one tablet.

Finally, let’s review the shortcomings and things to be improved:
1. The vibration of the car will still affect the judgment, but if the error range is set properly, the impact will not be too much.
2. The wide angle of the camera and whether the captured image will be distorted and needs to be adjusted. There is only one camera to judge the front. If you want to judge the surroundings of the car body, you need multiple cameras to assist.
3. The Yolo module is very good, but occasionally there will be a little misjudgment at night, how to reduce the misjudgment needs to be adjusted.
4. If you are waiting for a traffic light, if the car is in the front row and is close to the zebra crossing, the moving vehicles and pedestrians in front may be taken into consideration.
The reason is that it is impossible to determine whether the own vehicle has stopped, and the car dealer needs to provide an API to obtain vehicle-related information such as vehicle speed, control speed, etc.
5. The judgment parameters of the application can still be optimized.

The advantages are:
1. With the basis of the yolo module, the main vehicle in front reminds the driver to keep the distance between vehicles with high accuracy.
2. When in action, yolo’s detection is still sensitive
3. The application program can be moved to another vehicle, electric locomotive, etc. through a high-speed computing tablet device. Experience what machine learning can do without buying a new car.

--

--

Czxdas
Czxdas

Written by Czxdas

Keep looking for Prajna wisdom

No responses yet