Bilkent University

Mean-shift Based Moving Object Tracker

Moving objects are characterized by their color-histograms. Therefore the key operation of the object tracking algorithm is histogram estimation. Mean-shift tracking algorithm is an iterative scheme based on comparing the histogram of the original object in the current image frame and histogram of candidate regions in the next image frame. The aim is to maximize the correlation between two histograms.

Object tracking for an image frame is performed by a combination of histogram extraction, weight computation and derivation of new location.

Sample result images:



Figure 1: Moving object tracking results; frame 1, 10, 20, 30, 60 and 70.

Sample Result Video Clip:

Click image to see sample result video file.


How to Use Tracking Code?

Mean-shift based tracking code was developed by using C++. Download the C++ header and source files ObjectTracker.h and ObjectTracker.cpp and include those files in your project. The following steps should be performed in order to use the tracking code.

1- To construct tracker object:


CObjectTracker *m_pObjectTracker = new CObjectTracker(INT32 imW,INT32 imH, 
                                                      IMAGE_TYPE eImageType);

imW and imH: Image width and height respectively.
eImageType : Describes how many bits are used per pixel such as 24 or 32. 
             The definition of IMAGE_TYPE can be found in header file.

2- To initialize object parameters in the first frame:


m_pObjectTracker->ObjectTrackerInitObjectParameters(SINT16 x,SINT16 y,
                                                     SINT16 Width,SINT16 Height);

(x,y)        : The center coordinates of object box.
Width, Height: The width and height of the object box.

3- To track the object in the next frames:


m_pObjectTracker->ObjeckTrackerHandlerByUser(UBYTE8 *frame);

frame: Frame buffer to be processed.

4- To delete tracker object:


delete m_pObjectTracker, m_pObjectTracker = 0;


Contact details:

Halil I. CUCE
E-mail: hic@ee.bilkent.edu.tr