In this lesson, we will show you how to use Raspberry Pi camera to “see” the line and make auto driving. We will use a famou computer-vision software library called OpenCV.
Everything same as lesson 6 , but the camera must facing down to the tracking line.
Step 1) Install OpenCV library for Python3 by following command:
sudo apt update sudo apt install python3-opencv
Step 2)Download Lesson 7 sample code :
Step 3)run the code:
Note: If you want to debug the opencv code, you can uncomment all the cv2.imshow statements in line 22,120,125. Then connect the pi to a display device(we highly command you use OSOYOO 5″ DSI screen). Then you will see how the OpenCV transform the camera video into line data and then control the car movement.
DownLoad Url osoyoo.com