In this project, we are going to demonstrate how you can drive a car simply by detecting gestures on the steering wheel. Let`s say a requirement is something like this —
For this project we need to import two Python libraries — OpenCV and numpy . How to install these two libraries.
1) pip install opencv-python 2) pip install numpy
Below is the implementation:
Code # 1:
We imported two libraries named opencv and numpy st rong>. Then in the next line we use the
VideoCapture (0) opencv function and the
VideoCapture (0) parameter as 0 because your laptop`s webcam supports port 0 for using the camera. Now use the
CascadeClassifier (& # 39; hand.xml & # 39;) function and pass the xml file as a parameter. Save the hand.xml file in the same directory as the Python file.
Code # 2:
In this section of code we use a counter that can help us start the car engine, and after starting car we use contour counting on the steering wheel.
GitHub project link — Click here