I want use the line detection to guide a vehicle to maintain the vehicle always at the center of the line. I will use the ROI function to find the line cut by a ROI of a rectangle of 640 pixels wide and 4 pixels high. The vision system will look at the ROI as a cat eye an the x value of the lines detected will be used to move the motor to keep the line in the middle, it means around x=320 aprox.
Next step:
Create a ROI region of interest. Rectangular shape. 640x4 pixels
Calculate the desviation Of the line location from the center, the center nominal should be at 320 in X
Calculate the difference between real X and 320 and give a value as an tracking error.
I will add a PID algorithm
I will add the H bridge control subroutine for two motors to speed and change the direction to correct and move the vehicle to locate the center of the line at the center of the Camera image.
....
For complete example for line tracking using a video to check the code, please visit
https://github.com/naokishibuya/car-finding-lane-lines
.........................................
If you did like this project you can donate some cents of Crypto currency
Bitcoins SV in the following address.
1sAZQMy5Ci1G88CmbucFJDsF7TxeXAcko
or bitcoin cash in the address:
qzmjpeqrlgd3flltpavm9t2xh0nz8y97mggajvvqnv
or Stellar XLM in the address:
GBAWDPQ4FTRXWE2ZUWVYYZ7XSCQGBYZGOWQMAHSA2FPGJ5QTLF4IJ3NX
thanks
Instalation of OpenCV2 for Windows to use it in Python.
https://sourceforge.net/projects/opencvlibrary/files/opencv-win/2.0/OpenCV-2.0.0a-win32.exe/download
Comments