Human Motion Detection refers to the process of moving the human body in the input video images, including the position, scale, and posture,
Human body tracking is the process of determining the human body correspondence between frames in a video image sequence.
A series of processing methods such as low-pass filtering, background difference, morphological image processing, and Region connectivity analysis can be used to extract motion objects from video images, then, human body recognition is performed based on the features of human body height, width, and ratio.
After detecting the human body, you can use the camshift algorithm and the Kalman filter algorithm to track the human body.
Common Methods for Moving Object Detection: background subtraction, frame difference method, optical flow method,
Inter-Frame Difference Method: In an image sequence, the inter-Frame Difference Method subtract the pixel values of two adjacent images or two images separated by several frames, and the threshold value is used to extract the moving area of the image. Its main advantage is that the algorithm is easy to implement, but it is not sensitive to changes in the scene light, and is not significantly affected by the target shadow. The problem is that "when the target surface has a large gray-scale even area, a" hole is generated in the above area of the target ": the larger the target motion speed, the detected area is larger than the actual area. When the target motion is slow, the detected area is very small and the target motion cannot be detected.
Background difference method: the difference between the current image and the background image is used to detect the moving area. This means that each frame of the image is subtracted from the background image. If the difference is greater than a certain threshold, the moving target is determined, the result of subtraction directly shows the position, size, shape, and other information of the moving target. The difference method needs to constantly update the background frame to keep the exact approximation with the actual background.
Optical Flow Calculation Method: optical flow is the velocity distribution of the movement of each pixel in an image. It is a smoothing velocity field, that is, a vector field. Each vector represents the instantaneous changes of a point in the scene in the image. The optical flow method extracts human motion by calculating the pixel displacement between frames based on the characteristics of moving objects in image sequences with time changes. Its advantage is that the optical flow not only carries the motion information of the moving target, but also carries rich information about the three-dimensional structure of the scene, which can detect objects with independent motion, you do not need to know any information about the scenario in advance. It is applicable to static Motion Background, camera motion, and adaptability. However, its disadvantage is obvious. This method uses Iterative Computing and requires a long computing time, which cannot meet the real-time requirements. In addition, this method is greatly affected by the noise, therefore, it is applicable to scenarios where the image noise is relatively small and the target motion speed is low.
Statistical Method: extract motion information from the background based on Pixel statistical characteristics. It first calculates the statistical information of background pixels, such as the gray border of colors), and uses individual pixels or a set of pixel features to establish a relatively advanced background model, in addition, the Statistical Value of the background can be dynamically updated. By comparing the statistical value of the current background model, each pixel in the image is divided into foreground or background. However, the statistical method involves a large amount of computing and transformation, which requires high requirements on existing hardware devices.
Target Tracking
Visual tracking algorithms are classified into four types: region-based tracking, feature-based tracking, deformation template-based tracking, and model-based tracking.
Image Denoising:
Spatial domain image smoothing:
1-neighbor mean filtering (replacing the gray scale of each pixel with the average of several pixels. There are 4 and 8 neighborhoods. This method is effective for processing the added noise, but may cause high-frequency image edge blur, and the degree of blur is proportional to the size of the adjacent template .)
2. Median Filtering (a non-linear signal processing method. Move a template containing an odd number of pixels one time on the image, sort the gray values of all pixels in the template, and then take the middle value as the gray value of the middle pixel, it has a strong printing capability on isolated noise pixels. Because it is not a simple mean value, so produces less blur. It eliminates noise while keeping the image details. However, the window is not too big, otherwise the edge information of the image will be lost .)
3 space domain low-pass filtering (image information is usually concentrated in the low-frequency part, and noise is in the high-frequency part)
Low-pass filtering in Frequency Domain
Morphological Image Processing
After foreground detection, holes are generated in the detected area of the human body. Therefore, morphological image processing is used to fill the target.
Small holes in the area.
The on operation can eliminate the details of the image smaller than the structure element, smooth the outline of the object, disconnect the narrow connection, and keep the local shape of the object unchanged;
The closed operation can also smooth the outline of an object, but unlike the open operation, the closed operation can connect narrow gaps and fill holes and gaps smaller than the structural elements.
(Closed operations are used to eliminate small holes in the moving target)
Region connectivity analysis
When the area of a China Unicom region exceeds a certain threshold, it is deemed that a target exists.
Human Tracking Using camshift Algorithm
The camshift algorithm is a continuous adaptive Mean Shift algorithm. It is an algorithm used to track the probability map Centers Based on the target color. This algorithm is highly stable and can detect fast moving objects.