SIVP Toolbox
Last update : September, 2008

camshift - Track an object by color. It gets the object position, size and orientation.

Calling Sequence

obj_win = camshift(im, init_win)
obj_win = camshift(im)

Parameters

Description

The function implements CAMSHIFT object tracking algorithm. When using it, please first use obj_win=camshift(im, init_win) to initialize the tracker, then use obj_win=camshift(im) to track the object.

Examples

	
    n = aviopen(SCI+'/contrib/sivp-svn-trunk/images/red_car_video.avi');
    im = avireadframe(n); //get a frame
    obj_win = camshift(im, [12, 6, 39, 13]); //initialize tracker

    while ~isempty(im),
          obj_win = camshift(im); //camshift tracking          
          
          im = rectangle(im, obj_win, [0,255,0]);
          imshow(im);

          im = avireadframe(n);
    end;

    aviclose(n);

Authors

Jia Wu <jiawu83[at]gmail.com>
Shiqi Yu <shiqi.yu[at]gmail.com>

Bibliography

"Computer vision face tracking as a component of a perceptual user interface", G.R. Bradski, in Workshop on Applications of Computer Vision, pages 214, Princeton, NJ, Oct. 1998.

Availability

The latest version of SIVP can be found at

http://sivp.sourceforge.net

See Also

meanshift,