Description
The library provides a Kalman engine for tracking purposes. In the
application described below, the CAMSHIFT color tracking algorithm is used
to provide measurements for the X-Y tracking of a face (or other colored
object). The CAMSHIFT algorithm implemented here just uses a simple 1-D Hue
histogram sampled from the object using an HSV color space. Therefore,
the color tracker may need some tuning as described below (see CAMSHIFT demo
description page for more details).
Note that this filter requires that you have DirectShow 6.0 or greater installed
with graphedt.exe (DirectShow 6.0 for NT4.0, DirectShow 7.0 for
Win 98 or Win2000)
(http://www.microsoft.com/downloads/release.asp?ReleaseID=16927 ~128MB[!]).
You will also need a video camera source filter which should
be supplied by your USB camera vendor.
Microsoft* Windows* 2000 may be the most suitable operating system
for development since many vendors do not supply filters for
Windows NT 4.0. However, Windows 98 will be adequate for just
running the filter graph.
Kalman Color Tracker Demo
You should setup or launch the following DirectShow filtergraph (of
course, your capture source will depend on your USB camera):
Controls
The control panel for the filter (obtained by
right-clicking) the Kalman filter in the filter graph above looks like:
[1] This controls move the
sample window around when you are not tracking.
[2] This is the minimum saturation for a
Hue pixel to be accepted threshold.
[3] This is the minimum brightness for a
Hue pixel to be accepted threshold.
[4] This allows you to toggle between the
raw video image and the Hue histogram backprojected image.
[5] Sample color under box [1] and start
Kalman tracking.
[6] Stop Kalman tracking.
How to
Start Tracking
1. Select Normal view [4].
2. Set the thresholds to zero [2] & [3].
3. Move the sample box using [1] so that it covers the colored object to be tracked.
4. Press "Start Track" [5].
Tuning the tracking:
1. Select Back Project view [4]. The goal is to have the image
such as on the left below to look like the cleaner image on
right below.
2. Increase minimum saturation threshold [2] to clean up the image
without diminishing the object of interest too much.
3. Increase minimum brightness threshold [3] to finish the
"clean up" job. Don't turn too high or else bright
spots on the tracked object will become
"holes".
4. Turn normal view back on [4].
Display
The meaning of the normal view display is as follows with
reference to the figure below:
[A] Velocity direction and
magnitude estimation.
[B] Sample window if not
tracking, tracking window if tracking.
[C] Estimated location of
the object.