Background subtraction is
a common practice in surveillance applications. However, maintaining a
background while the camera is moving is much more involved than that in
a static camera case. One has to warp the previous background to the current
view, detect changes, and update the current background.
I studied the case of a moving
camera mounted on a pan-tilt head (a mini-robotic arm). The displacement
of the camera center caused by the pan-tilt head is small enough and the
parallax it introduced can be safely ignored. That way the warping between
the two successive views can be modeled by planar homography. Or in this
special case, the warping can be parameterized by 3 parameters, current
pan, delta pan and delta tilt.
Though the pan/tilt angles
can be read from the pan/tilt unit, they are not accurate enough for warping
purpose, especially when the camera is on the fly. In this case the exact
angles must be computed from the image. I used Sum of Squared Difference
(SSD) methods, an iterative gradient descending algorithm to register two
successive images. The derivation of the Jacobi is a bit complicated.
After two successive frames
are registered, the moving target can be detected and the background can
be updated. In the following example the first two images are two successive
images in a video stream. Detected changes are shown in the third image.
The camera is assumed calibrated.
Also please watch the following
videos to see the algorithm in action. The frame rate was 10-15fps on a
P2 200 machine.
4.0M AVI |
4.8M AVI
|
|