This is an image-detection program written for a Scribbler2 robot with an IPRE Fluke2 add-on board for the final project in Montclair State University's Fall 2016 CSIT 431: Artificial Intelligence course. Scribbler2 is a simple 2-wheeled robot 2 IR obstacle sensors, 2 IR line-detection sensors, and 3 indicator lights that is used primarily to draw figures (hence the name) using a remote or pre-programmed routine. The Fluke2 board adds a camera, 3 additional IR obstacle sensors, a battery voltage sensor, and Calico, a framework that supports a wide range of languages including Python and provides Myro, a library for robot control.
The goal of this project was to have a Scribbler be able to detect and follow another Scribbler robot using its camera to detect the color and the shape of the red box on top of the first robot. The image detection was implemented using the blob-detection function from the Myro library. The algorithm uses a grid to try to keep the box centered in the camera's field of view. By counting the pixels that falls in each section of the grid, the follower robot is able to adjust not only horizontally when the target veers left or right, but also maintain its distance by moving backward or forward when the pixel count deviates above or below the desired range.
The program was written in Python using IPRE's Calico framework with the Myro library.
For more videos on this project and my other Scribbler assignments from CSIT431, go to YouTube channel.