How to Detect and Track Object With OpenCV

The detection of an object by a robot is a job in the machine vision system. Based on the idea to duplicate the human vision ability, a computer vision system use electronic parts and algorithms instead eyes and brain. The Open Source Computer Vision Library (OpenCV) is the most used libraries in robotics to detect, track and understand the surrounding world captured by image sensors.

OpenCV is an open-source library opened to everyone who wants to develop and add new functionalities. It can be downloaded and installed on Ubuntu, Windows or OS X operating systems. Installation guide with steps and setup is available here.



OpenCV is compatible with next compilers:

  • Ubuntu: GCC 4.4.3 (Ubuntu 10.04), GCC 4.6 (Ubuntu 11.10), GCC 4.6.3(Ubuntu 12.04);
  • Windows: MSVC 2008, 2010, MinGW 4.5.1 x64, 4.6 x86;
  • MacOS: GCC 4.2.1 ;

In order to get started using OpenCV, I made an overview of tutorials and resources focused on OpenCV library.

Detect and Track Objects With OpenCV

In the following, I made an overview of tutorials and guides to introduce you to the world of the OpenCV library for detection and tracking objects. OpenCV is a library for computer visions designed to analyze, process and understand the objects in videos and photos aiming to produce information.

  • OpenCV Tutorials – a comprehensive list of basic OpenCV tutorials and source code based on the OpenCV library;
  • Object Detection & Tracking Using Color – an example of an application where OpenCV is used to detect objects based on color differences;
  • Face Detection Using OpenCV – guide how to use OpenCV to detect one or more faces from the same image;
  • SURF in OpenCV – tutorial how to use SURF algorithm designed to detect key-points and descriptors in images;
  • Introduction to Face Detection and Face Recognition – face detection and recognition are two of the most common applications in computer vision in robotics, and this tutorial present the steps how a face is detected and recognized from images;
  • Find Objects with a Webcam – using a simple webcam mounted on a robot and the Simple Qt interface designed to work with OpenCV, you can detect and track any object captured by the camera;
  • Features 2D + Homography to Find a Known Object – tutorial with programming code and explanation in order to use two important functions included in OpenCV. These two functions – findHomography and perspectiveTransform – are used to find objects in images. The findHomography is a function based on a technique called Key-point Matching while the perspectiveTransform is an advanced class capable of mapping the points from an image;
  • Back Projection – tutorial based on calcBackProject function designed to calculate the back project of the histogram;
  • OpenCV Tutorials – Based on “Learning OpenCV – Computer Vision with the OpenCV Library” – in order to become familiar with computer vision concepts, these tutorials can be useful for the beginner and advanced users to start building applications or to improve the skills;
  • Image Processing on Pandaboard using OpenCV and Kinect – in this presentation you can find information about image processing with a Pandaboard single board computer using the Kinect sensor and the OpenCV library;
  • Video Capture using OpenCV with VC++ – OpenCV library can be integrated with Visual Studio, and this article explains you as a programmer how to use the Visual C++ together with OpenCV;

Tutorials to Detect and Track Objects with Mobile Devices

iOS or Android mobile devices such as smartphones and tablets can be integrated into robots and used to detect and track objects. Below, I made an overview of tutorials that explains you how to detect and track objects using different mobile devices.


Below is a list of resources including OpenCV documentation, libraries, and OpenCV compatible tools.

This article was last modified on 14 April 2014.

Robotics community only grows by sharingShare on FacebookShare on Google+Tweet about this on TwitterShare on RedditShare on StumbleUponDigg this

8 comments » Write a comment

  1. i am thinking of a project for my final year, which is automatic field cleaning robot.
    But i dont know from where to start. First i am thinking of the object detecter. What kind of sensor is suitable for my robot to detect the object and collect it. Can anyone help me please.

    • Hello,

      If you click on tutorials you can easily find what sensor can be used for object detection.

  2. i want to detect a cheese slice and then cut it in a proportion of desired size. please help

  3. this such bullshit,…..cant even follow along cuz the libraries arent installed on my windows8.1

  4. i m developing iOS App , Augmented Reality virtual trial room , how to detect camera a object/image , please give solution

Leave a Reply

Required fields are marked *.