Use of webcam in controlling Sumo Bot

A sumo bot has multiple states which includes wandering, tracking, contact, and avoid boundary. Tracking state is the state where the robot is on the look for the opponent and it is in this stage that it uses the attached webcam.

There are two stages involved in this process. In the first stage, the webcam records a frame and saves it. In the next stage, the recorded frame is analyzed.

The record stage is very simple. The robot needs to be programmed how frequently it needs to capture the frame. A too low frame capture rate could mean that the sumo bot would be slow in detecting the opponent and the opponent might detect and attack earlier. A too high frame capture rate would increase the data transfer volume and processing and might make the overall system slow and cause the bot to malfunction. It is important that the frame capture rate be chosen after proper experimentation.

In the image analyzer stage, the recorded frame is analyzed and it is determined whether the robot has detected the opponent or not. In order to detect the opponent, the sumo bot needs to know how what the other opponent looks like. Hence, we need to specify the "looks" of the other sumo bot in terms of what color it is of. Every colored object is made up of a combination of three colors: Red, Green and Blue. So, we need to identify the color of the opponent and define its color in terms of it's RGB levels. It is recommended that the color be specified in terms of ranges rather than absolute values. Determining and setting the color ranges can only be done after experimentation.

Once these two processes have been programmed, the robot will take images and transfer them. These images will then be analyzed to see if the robot has detected the opponent. Upon a successful detection, the robot will make it's strategy, which is normally to move and attack the other sumo bot.

It is also important that the camera on the robot be positioned carefully. Although this depends on how the bot is constructed, the webcam has to be installed such that frame it captures should have a large color sample. Hence, placing the camera too high or too low might not be very effective. An ideal position for it would be in the middle where the frame will have a large image of the other bot.