File Exchange

image thumbnail

Color Object Tracking

version (2.99 MB) by Alireza
A color object tracking method based on the object and background colors.


Updated 07 Sep 2015

View License

This code is a matlab implementation of a color object tracking method based on the object and background colors.
The code runs on Windows/Linux with MATLAB R2011-2013.
A test sequence "test.avi" is included so you can simply run Demo.m
Object center locations are saved in output.mat
This code presents an object tracking method based on the object and background colors. A three dimensional feature vector is used to describe color feature (R, G, B) of each pixel. A quantized histogram of that feature value of pixels on the selected object and a quantized histogram of pixels from the neighborhood surrounding the object are developed. The RGB based joint probability density function of the selected object region and that of a neighborhood surrounding the object are used to separate object from background. An adaptive color model of separated object is developed to detect the object in subsequent frames while simple Mean-shift procedure on binary images is used to track the object (it is actually a simple centroid shift on the binary map of object detection result).
This code is used in the following paper: Alireza Asvadi, MohammadReza Karami and Yasser Baleghi, "Object Tracking Using Adaptive Object Color Modeling" in Proceedings of the 4th conference on information and knowledge technology (IKT2012), Babol, Iran, May 2012.

Cite As

Alireza (2020). Color Object Tracking (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (7)

m x

why does it track only one person?
what about the car and the other three persons?

Haris Elahi

HI SIr how to do it with live video please Sir reply...


@Chow Han Lim Hi, save all the centroids and plot them at the end

Chow Han Lim

hi good day, how do you plot the continuous lined green dots? which part of the code?


??? Error using ==> Demo at 24
The file requires the following codec(s) to be installed on your system:

nursyafika idris

wang chongfei

MATLAB Release Compatibility
Created with R2011a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!