next up previous
Next: Heuristics and Prior Knowledge Up: Detection and Localization of Previous: Introduction

Motion Detection

To detect and analyse movement in a video sequence, we perform to following four steps:

1.
Frame differencing
2.
Thresholding
3.
Noise removal
4.
Add up pixels on each line in the motion image

First we find the difference between the current frame in the video sequence and the previous. If the difference between the pixel values are greater than $\mathit{(colors\,\,used)}/10$, the movement has been significant and the pixel is set to black. If the change is less than this threshold, the pixel is set to white. This image (figure 2) now indicates if something has moved and and where the movement is located.

In the thresholded image, there may be noise. To remove the noise, we scan the image with a $3\times3$ window and remove all black pixels which are isolated in a white area. If the center pixel of the $3\times3$ frame is black and less than three of the pixels in the frame are black, we remove the black center pixel because it is probably noise. Otherwise the pixel remains black. This way we detect only "large" moving objects.

This motion image is used to add up how many black pixels there are on each line (figure 3). We use this image to find the upper moving object in the images. If there are three lines with movement greater than fifteen pixels below each other, we assume this is an object, not just single pixels with movement. By using the information about how much motion there is on each line, a point in the middle of the upper moving object is calculated. This is done by calculating the center of the object within a square of a fixed size ( $40\times40$ pixels). The average width of the object is calculated and the center pixel is where this $\mathit{(average\,\,width)}/2$ cross the twentieth line from the top of the moving object. This procedure is repeated for frame sizes $60\times60$and $80\times80$.


  
Figure 2: A typical motion image.
\begin{figure}\begin{center}
\epsfig{file=bevdet.ps,height=5cm}
\end{center}\end{figure}


  
Figure 3: Amount of pixels on each line in the motion image.
\begin{figure}\begin{center}
\epsfig{file=bevdetlinje.ps,height=5cm}
\end{center}\end{figure}


next up previous
Next: Heuristics and Prior Knowledge Up: Detection and Localization of Previous: Introduction
Erik Hjelmås
1998-09-15