Tuesday, December 7, 2010

Based on DM642 moving target detection system design and implementation (1)

Introduction

Digital video systems in intelligent transportation, image recognition, and security monitoring and other fields, have been widely used, moving object detection as a digital video systems, is an important part of the follow-up to the objectives of identifying, tracking, and so on the basis of the application.

This article presents a real-time based on DM642 motion detection system, relying on the powerful computing DM642 chip to target detection data throughput and real-time performance guaranteed. The programme design reasonable, scalability, the actual value.

1 moving target detection algorithm

For motion detection algorithm, there are many, optical flow, background difference method and the adjacent frame subtraction method.

Optical flow through solving optical flow equations for motion detection, the algorithm is complex, compute-intensive, and difficult to meet real-time requirements; and the adjacent frame subtraction method while the algorithm is simple, the operation of small, but very poor anti-jamming ability, detection is not very ideal; while background difference algorithm is simple, the operation quantity is small, and strong anti-interference ability, so this article adopts the method for detection of moving targets. The steps are as follows: first obtain a digital image preprocessing, after using background difference method for motion detection, then the image use Otsu method for Adaptive threshold segmentation, finally get through the filter detect moving objects. Figure 1 is a moving target detection of flowcharts.

1.1 image acquisition and preprocessing

In the configure system CCS video input and video output driver, from FVID TMS320DM642 's VPORT mouth gets into the camera capture video stream corresponding to digital YUV video stream, store it in a cache IMG_CURRENT, IMG_PREVIOUS, inside of which IMG IMG_BACKGROUND CURRENT holds the current image, IMG_PREVIOUS holds the last stored image, IMG BACKGROUND image stored as a background image.

Image resolution is 720 × 576, each component is 8 bit. Due to the acquisition of video image inevitably contain noise, must be the noise suppression, this article uses the Gaussian filter on the YUV video information for Gaussian filter processing. Filter image saved to IMG_CURRENT cache.

1.2 background difference method

Video image after the preprocessed using background difference method to detect out-of-motion images, the steps are as follows:

(1) Gets a frame image as the initial background Bg (x, y, tk);

(2) the interval between 4 frames once again Gets the next image, as the current image Curr (x, y, tk);

(3) in accordance with the background difference method get difference image Sub (x, y, tk) = | Curr (x, y, tk,)-Bg (x, y, tk);

(4) the statistical value of all and set thresholds compared to FF, FF if less than the threshold, the press-Bg for background updates (x, y, tk) = α * Curr (x, y, tk) + (1-α) * Bg (x, y, tk-1);

(5) duplicate the front (2) to (3) steps.

Above background difference method, you can randomly gets turned on at all times of a frame image is the original background image.

In order to make the image more obvious differences between each interval, 4 frames to get the next image as the current image, background image by difference, the difference will be the difference image grayscale and set thresholds compared to FF, determine whether you need to update the current background, threshold values for FF, this article takes the experience 20000. Background update formula coefficients a reflects the background update speed, its range of [0, 1], a larger background updates faster, a smaller, slower background updates.

1.3 difference image binarization

On the difference image as described in the following two values:

Type of threshold TR use Otsu method gets.

In the actual testing found that direct use of Otsu method gets the threshold TR on differential image binarization for processing, if there is no motion, binarization image as noise of binary image, deal directly with the binary image in subsequent morphological filtering is very difficult to completely eliminate, by analyzing the difference image histogram, found when no body movement, the difference image histograms are mainly distributed in the 0 to 10, Otsu method gets the threshold of 1 ~ 6; when there is motion, the difference image histogram in 0 ~ 255, Otsu method gets the threshold to 20 above.

Based on the above analysis, this article uses an improved method, if the Otsu method gets the value of the valve is less than 10, then no motion, otherwise the object movement, when a threshold is less than 10, according to the following type for binary processing:

F (x, y, tk) = 0 when < 10 TR

That is, when there is no object, gets the binarization image should be all black, so that subsequent morphological processing simply on a motion of binary image processing.

Figure 2 respectively no motion direct binary and adoption of improved methods for binary. Which a) for direct use Otsu method gets the value of the valve motion segmentation is not the result of differential image, you can see that figure filled with noise; b) as to the Otsu method gets the value judgment of valve, there is no motion of the difference image segmentation results, as can be seen at this point the image is all black, that is, not moving objects, which correspond with the actual situation, simplifies the subsequent morphological processing.

[1] [2]

No comments:

Post a Comment