Reputation: 1260
I am trying to make a line follower using a cam stream using OpenCV.
What can be the problems?
My main idea was either to recognize contours of a ROI understanding what to do, or choose 9 ROI as it is 3*3 table so is able to recognize the path to follow depending on which regions are of the colour of the line.
Other ideas or suggestions?
Upvotes: 0
Views: 1553
Reputation: 1190
Well you could try this if you know the background colour of the line follower arena.
Set up the bot in the initial position and set up to ROI on either side of the line. Threshold and make sure the arena is inside the ROI boxes and let the ROI boxes be white in the thresholded binary image. (your line will be black and your background of arena should be white). Now use the following algo:
move forward if area of white in both ROI > a certain threshold area
turn left if area of white in left ROI < a certain threshold and right ROI is > the threshold area
turn right if area of white in right ROI < a certain threshold and left ROI is > the threshold area
Upvotes: 1