Переглядів 83
Demonstrate the use of the camera sensor in following an object (...using blob detection) and line following (...by reading the pixel data; I'm using HSV, but the same can be done with RGB).
In the blob detection example, the centroid of the largest detected blob is used control the steering of the robot, while the height of the blob (...which gives us an indication of the distance to the object) is used to regulate the robot's speed.
In the line following example, we use a single row from the image, and perform a weighted averaging to determine the centroid of the black area. This is then used to control the steering of the robot.