Image Processing based ball tracking robot

Published on . Written by

Image Processing based Ball tracking robot
One of the biggest problems that the field of surveillance faces is that it still involves humans. With technology replacing most humans when it comes to menial jobs, this is one field that is about to undergo major changes in the years to come. The change has already been set in motion, with several large corporations now relying on motion-detecting cameras to ensure the safety and security of their office spaces and employees. Object tracking is what makes motion-detecting sensors and surveillance cameras possible. But this same technology has another more playful side to it. In this image processing project, we will build a ball tracing and following the robot, which will monitor the motion of a ball and then follow it.

Read more..
Project Description


Skyfi Labs Projects
A system which autonomously monitors areas and detects movement has a lot of large-scale industrial application in today’s world. But in this project, we are going to be looking at the lighter side of things, as we build a robot which is at best, a fun toy. Making decisions related to navigation, and close monitoring of a target is what the robot will have to successfully do to keep track of the ball. Object tracking algorithms make use of both Computer Vision and Image Processing concepts to function properly. Hence, this project is in many ways a great way to familiarise yourself with the world of digital image processing.

Concepts Used

  • Fundamentals of Object Detection
  • Principles of Image Processing
  • Visual Data Analysis
  • Data Segmentation
  • Feature Extraction
  • Computer Vision Analysis
  • Edge Detection Algorithms
  • Basic Mechanics and Circuitry
  • Arduino/Raspberry Pi/Microprocessor Programming
  • Python Programming
Components Required

  1. Raspberry Pi/Arduino
  2. Camera module
  3. Ribbon cable
  4. Robot Chassis
  5. Gear motors and wheels
  6. L293D motor driver
  7. Dual H-Bridge motor drivers L298     
  8. SparkFun Dual H-Bridge motor drivers L298
  9. DC motors
  10. Breadboard
  11. Portable power source
  12. Jumper Wires
Project Implementation

  • The robot will be based on the simple model of an RC or robot car.
  • The car will have cameras attached to it to monitor and detect changes in the environment and to keep track of the ball.
  • Now for building this device, students can use either an Arduino or Raspberry Pi interface, depending on whatever they are comfortable with.
  • The first step is accessing the live video stream captured by the camera.
  • Now, this stream will be studied and features such as the ball’s color, shape and size are extracted and analyzed.
  • This robot will have a pre-set color in its program, and it will chase balls that are of the same color.
  • Hence, the sample dataset will have balls of varying sizes and shapes of that particular color.
  • If students end up using a Raspberry Pi to control the bot, then it is best that they utilize a Raspberry Pi camera module to detect changes in the environment and code the program in Python by using the OpenCV library, for conduct digital image processing and analysis.
  • The motors of the car are attached to the controller and also to an H-Bridge which will switch positions to start or to stop the motors. The speed of the motors will also be controlled by this switching mechanism.
  • The code should also accommodate instances wherein there will be no ball insight. In such cases, the robot must be instructed to take a 360-degree shot and try to spot the target.
  • To conduct image processing, each frame is grabbed and then masked with the preset color. Then noise cancellation is done to smoothen out the images.
  • Next, an algorithm must find all the contours and spot the largest amongst them and then frame it into a box.
  • The rectangular box then becomes the main image, to which the robot tries to center its position.
  • Finally, we compare the coordinate value of the box and of the robot and then power the motors accordingly to move the robot towards the ball.
Kit required to develop Image Processing based ball tracking robot:
Technologies you will learn by working on Image Processing based ball tracking robot:


Any Questions?


Subscribe for more project ideas