Camshift Multiple Trackers Application and Source Code

Posted on Posted in OpenCV Tutorials, Projects, Tutorials, Windows Applications

This application demonstrates the implementation of multiple Camshift trackers to track multiple objects and regions in a video at the same time.
It is written in C++, using Qt and OpenCV. You can find the Executable and Source code at the bottom of this post.

When you run this program:
1. Open a video file or select Webcam as the video source
2. Select the objects you want to track in the video (select the region using your mouse)
3. Press “ESC” to stop the video, “p” to pause or un-pause and “k” to clear all of the trackers.

Camshift (Continuously Adaptive Mean Shift) algorithm is used for tracking regions of a video starting from any given frame throughout the next frames. The basis of this algorithm (as it can be inferred from its name) is the Mean Shift algorithm. For more information about the Mean Shift and Camshift algorithms you can visit the links below:

Mean Shift Wikipedia Article

Motion Analysis and Object Tracking

OpenCV: Mean Shift and Camshift

You can download the executable and source code from the links below:

Download Executable
Download Source Code

Please let me know if you find any problems in the program, or if you need help with compiling the source codes.

Below are some screenshots and a video from this program:

Leave a Reply

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