That is the second a part of the mission and right here we’re going to design Lidar-based Lane Detection System utilizing Raspberry Pi.
Within the earlier half, we designed the LIDAR-based surrounding mapping and Anti-collision system for our ADAS system so we are going to carry ahead the design for the detection of vehicles and highway lanes for the ADAS system.
Within the final design, we used the Raspberry Pi for that however right here you may change to Automotive grade SBC or Nvidia Jetson if you’re making it for studying then you need to use a raspberry pi as properly. So along with the elements wanted within the earlier mission, we have to get a number of extra elements listed within the invoice of fabric.
Invoice of Supplies
Elements | Amount | Description | Worth Approx INR |
Nvidia Jetson/Raspberry | 1 | 4GB Ram | 10,000 |
Webcam/Raspberry Pi cam | 1 | For night time imaginative and prescient /5 to 10 MP | 1000 |
SD card | 1 | 32/64 GB | 1000 |
HDMI 7 INCH Show | 1 | HDMI Show | 3000 |
Whole | 15,000 |
NOTE:- You may also use a Raspberry Pi with 2GB or 4GB of ram and I’m utilizing right here the NVIDIA Jetson only for Automotive grade requirement
Connection
For the car get the 5V 4 amps energy output from the car. If masking for testing solely, then you may energy the NVIDIA JETSON with 5V 2A USB cables.
Now we have to join the digital camera to NVIDIA JETSON. Right here you may both use a ribbon cable-based CSI digital camera or any USB digital camera.
Subsequent, join the Nvidia jetson with the HDMI show and energy that show with USB energy. And for lidar connection, you may check with the earlier article on this collection of ADAS designs.
Lane Detection System – Code
I assumed you could have already ready the NVIDIA Jetson with OS and Python atmosphere; if not, then try this utilizing the instruction on the following hyperlink.
Now first we have to set up the open CV for processing the picture wanted in our ADAS system. utilizing the linex terminal after which we set up the quantity processing the numbers
sudo pip3 set up opencv
sudo pip3 set up numpy
Now after putting in the modules, we’re able to code.
First, we import the numpy and OpenCV, then we set the digital camera for making the video body utilizing OpenCV, then we create the loop perform for processing the video frames after which detect the perimeters, land pedestrians, and vehicles.
Now we show the processed body in a loop on the HDMI show now we have linked to.
Combining the Anti-collision System and Lane Detection System for ADAS
As we have already got made the code to make use of lidar to map environment and look at the map in real-time and alert the driving force when any impediment comes very nearer to the automotive to keep away from accidents. So now combining each codes with working on the identical time exhibits the LIDAR map and Lane detection video on HDMI show hooked up to the automotive dashboard.
import subprocess
subprocess.run(python3 script1.py & python3 script2, promote = True)
To try this, we use the Python subprocess and create one other code that runs each Python scripts concurrently.
Lane Detection System Testing
Now after connecting the LIDAR, CAMERA, and Powering the Nvidia Jetson we run the ADAS Python script, and now we will see the output on the HDMI display.