Colour-based object tracking with Raspberry Pi

This robot uses a Raspberry Pi 3 and one of our cameras to detect the colour of the objects it drives past. It’s trained to follow objects of one specific colour.

Samiya Farooquee from Integral University in Lucknow, India gleefully posted on LinkedIn that she’d just submitted her final year project. When we noticed it was Raspberry Pi-powered, we got in touch to learn more about how she built it and what she aimed to achieve with the project.

She worked with Shafat Insha and Midhat Munira to develop a smart colour-based object tracking system, using OpenCV and Raspberry Pi 3. The autonomous Smart Object Tracking Robot can detect and track objects of a specific colour in real time.

Training the robot on a multicoloured cube

The design, development, and technical details of the project are all available on Samiya’s GitHub, but stick with us for a breezier overview.

Hardware

Software

  • OpenCV (computer vision library)
  • VNC Viewer (for remote operation of the robot, in case you need to take over)

How does it work?

The Raspberry Pi Camera Module captures live video frames. The onboard Raspberry Pi 3 then processes these frames using OpenCV in real time as the robot drives around.

The robot’s wheel motors are controlled via the Raspberry Pi’s GPIO, and the device reacts autonomously to objects detected in the camera’s field of view. It is programmed (in Python) to follow, turn, or stop based on the position, size, and colour of the objects it detects.

For example, if the robot’s camera sees an object of the colour it is following, it will activate the motor driver board and move towards the object.

Wheeeeeee!

Colour tracking

For this project, the team chose to use the HSV colour space to give their robot its colour differentiation powers. HSV stands for hue, saturation, and value. It’s closer to the way humans perceive colour than the more familiar RGB and CMYK spaces, which rely on primary colours.

In this instance, the robot is trained to track and follow only yellow objects. The code can be adapted to track objects of different colours. Tracking shades of brown could be useful if your robot was an outdoor pet and you didn’t want it rolling through animal poo, for example. Or you could have it avoid the colour green if you wanted it to stick to paths through grassy areas. Not sure why I’m so focused on animal poo in grass. Let’s move on.

Aspirations and thanks

The team’s aim was to highlight the potential of robotics and computer vision in industrial applications. They’ve just graduated, but they have left the robot in their university lab to see how future students build on their ideas.

The team behind the build sat on steps inside their university
Family photo

I also couldn’t turn down a heartfelt request to shout out to Mohd Zaid from Integral University, whom the team called their “guiding star and exceptional mentor”.

We hope future students will let us know if they modify the Smart Object Tracking Robot.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Server Status

Aradippou Chat Larnaca Nicosia

Chat Links

Official Links.

Chat.

Alternative Mirror Links.

1. KiwiIRC 1.
2. KiwiIRC 2.

Other Web Clients.

1. IrcCloud.

Recent Posts

Related Posts:

Archives

Follow me on Mastodon

Super Club Radio

Mighty Deals

CyIRC

CyIRC Tweets