Moving target detection method and system based on convolutional coding
Through a method based on convolutional coding, using three-channel convolutional coding templates and inter-frame difference operations, the problems of weak anti-interference ability and poor detection accuracy of moving target detection in the existing technology are solved, and efficient moving target detection is achieved. Suitable for complex environments and various application scenarios.
Patent Information
- Application Number
- CN202111133777.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-27
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2041-09-27
AI Technical Summary
Existing moving target detection methods have shortcomings in weak anti-interference ability, poor detection accuracy, and slow detection speed. It is especially difficult to effectively detect moving targets in complex environments.
Using a method based on convolutional coding, by establishing a three -channel convolutional encoding template, the color video is used to encode frame input, and the background model is simplified by using the inter -frame differential operation, the calculation volume is improved, the detection speed is improved, and the left negative right is positive. The weight principle eliminates shadow interference and marks the area where moving targets exist.
It significantly improves the accuracy and speed of moving target detection, reduces hardware costs, can effectively detect moving targets in complex environments, and is suitable for a wide range of application scenarios, including autonomous driving and intelligent transportation.
Smart Images

Figure CN113936030B
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of computer vision, and in particular relates to a moving target detection method and system based on convolution coding. Background Art
[0002] The problem of moving target detection has always been a focus in the field of computer vision, and its application scenarios are also very wide. It is used in many scenarios such as security alarm, home monitoring, road traffic, driving navigation, video conferencing, etc.
[0003] Scientists at home and abroad have proposed many algorithms for moving target detection. Wren et al. proposed using a single Gaussian model to describe the background. This model is suitable for static and stable backgrounds and is not suitable for target detection tasks in complex environments. To solve the problem that a single Gaussian model is difficult to describe complex backgrounds. Stauffer et al. proposed using a mixed Gaussian model GMM (gaussian mixture model) to fit the background, which achieved target detection under complex backgrounds. However, when encountering a simple background, it will incorrectly learn the grayscale of the foreground, resulting in target loss, and the training complexity is high and the threshold selection is difficult. In addition to the above-mentioned parameter models, there are also non-parameter models, such as the codebook model, which establishes multiple codewords for each pixel and calculates the upper and lower bounds of each codeword, which can effectively achieve segmentation for different scenes. However, once the foreground appears in the establishment process of this algorithm, it will cause codeword errors, which will continue to cause false detection until the next codeword update, and cannot adapt to more drastic environmental changes. Barnich proposed a non-parametric model, Vibe, which can quickly build models and use neighborhood pixels to adopt random strategies to update the background. It can effectively adapt to various environments, but it has strict requirements on the update rate. If it is too fast, the target will be absorbed and a hole will be generated. Otherwise, it will easily produce ghosts and cannot adapt to environmental changes. In addition, Vibe has a low recall rate when using a fixed threshold grayscale video. Min Weidong et al. proposed an improved Vibe model to optimize the ghost problem, but still cannot solve the problem of slow foreground producing holes. Another non-parametric model is the kernel density estimation method KDE (kernel density estimation) proposed by Elgammal. The distribution of the background is obtained by counting the histogram of pixel points, and the kernel density function is used to estimate the probability of each point being the background. Compared with Gaussian modeling, it can better reflect the real distribution and estimate complex backgrounds more accurately. The disadvantage is that it can only obtain the probability, the judgment threshold is difficult to set, and the probability calculation complexity is high.
[0004] In addition to traditional methods, deep learning has also been applied to moving target detection in recent years. However, both traditional methods and deep learning methods have obvious shortcomings. For example, traditional methods are not robust enough, and the detection effect is unsatisfactory when there are multiple interferences. Although deep learning methods have greatly improved in robustness, the preparation and improvement of data sets have always been a problem, especially in real life, there are various moving targets, and it is difficult for data sets to cover all of them. In addition, deep learning methods have too high hardware requirements, which limits their large-scale application. Summary of the invention
[0005] The purpose of the present invention is to provide a moving target detection method and system based on convolutional coding, so as to solve a series of problems of the moving target detection method in the prior art, such as weak anti-interference ability, poor detection accuracy, slow detection speed, etc.
[0006] In order to achieve the above tasks, the present invention adopts the following technical solutions:
[0007] A moving target detection method based on convolutional coding comprises the following steps:
[0008] Step 1: Collect a color video to be detected, wherein the color video to be detected includes M frames of images, where M is a positive integer;
[0009] Step 2: Establish a three-channel convolutional coding template, the size of the three-channel convolutional coding template is N×N / 2×3 and N∈[6,8,10], the three-channel convolutional coding template includes two left and right sub-templates, the size of the sub-template is N / 2×N / 2×3, the weights of the three channels of each pixel in the left sub-template are negative, the weights of the three channels of each pixel in the right sub-template are positive, and the absolute value of the sum of the weights of the three channels of each pixel in the left and right sub-templates is
[0010] Step 3: Input the color video to be detected frame by frame into the three-channel convolutional coding model obtained in step 2 for encoding, output the encoding result of each frame of the image frame by frame, screen frame by frame according to the encoding result of each frame and mark the area where the moving target exists in each frame;
[0011] Among them, for the mth frame, m∈[1,M], the encoding result of the mth frame image is a digital sequence obtained by subtracting the digital sequence obtained by encoding the m-1th frame image and the digital sequence obtained by encoding the mth frame image. When m=1, the encoding result of the 1st frame image is the digital sequence obtained by encoding the 1st frame image. When screening is performed based on the encoding result of the mth frame, the value less than the threshold in the encoding result of the mth frame image is screened out, and the convolution area corresponding to the value less than the threshold in the encoding result of the mth frame image is marked as the moving target existence area of the m+1th frame.
[0012] Furthermore, the weights of the three channels of each pixel in step 2 include an average scheme or a proportional distribution scheme, wherein the average scheme is that the weights of the three channels of each pixel are The proportional allocation scheme allocates the weights of the three channels of each pixel according to the proportion of the values of each channel in the three channels of each pixel.
[0013] Furthermore, in step 2, N=6.
[0014] Furthermore, in step 4, the threshold value is 5-10.
[0015] A moving target detection system based on convolutional coding includes a data acquisition module, a three-channel convolutional coding template and an output module;
[0016] The data acquisition module is used to acquire the color video to be detected, and the color video to be detected includes M frames of images, where M is a positive integer;
[0017] The size of the three-channel convolutional coding template is N×N / 2×3 and N∈[6,8,10]. The three-channel convolutional coding template includes two left and right sub-templates. The size of the sub-template is N / 2×N / 2×3. The weights of the three channels of each pixel in the left sub-template are all negative. The weights of the three channels of each pixel in the right sub-template are all positive. The absolute value of the sum of the weights of the three channels of each pixel in the left and right sub-templates is
[0018] The output module is used to encode the color video to be detected frame by frame using a three-channel convolutional coding model, output the coding result of each frame of the image frame by frame, and perform frame by frame screening according to the coding result of each frame and mark the area where the moving target exists in each frame;
[0019] Among them, for the mth frame, m∈[1,M], the encoding result of the mth frame image is a digital sequence obtained by subtracting the digital sequence obtained by encoding the m-1th frame image and the digital sequence obtained by encoding the mth frame image. When screening according to the mth frame encoding result, the value less than the threshold in the encoding result of the mth frame image is screened out, and the convolution area corresponding to the value less than the threshold in the encoding result of the mth frame image is marked as the moving target existence area of the m+1th frame.
[0020] Furthermore, the moving target detection system based on convolutional coding can be set in a local data storage and processing unit of the camera.
[0021] Compared with the prior art, the present invention has the following technical features:
[0022] (1) The present invention designs a simple and efficient coding template to simplify the background model into a digital sequence, thereby reducing the amount of calculation, improving the detection speed for moving targets, and reducing hardware costs.
[0023] (2) The present invention eliminates the interference of shadows on moving target detection to a large extent, thereby improving the accuracy of moving target detection.
[0024] (3) Most of the current mainstream algorithms are based on complex mathematical models such as GMM, KNN, etc. However, this method uses the idea of image coding to simplify each frame of the image into a digital sequence using a convolutional template, and the inter-frame difference operation is also carried out between digital sequences, which greatly saves computational costs.
[0025] (3) The present invention does not use target recognition, but uses inter-frame information to find moving targets without classifying them. Deep learning has always had obvious shortcomings in the field of moving target detection. First, the types of moving targets are uncertain. In reality, any object may move, that is, it may be a moving object. If deep learning is used to solve the problem of moving target detection, it is necessary to prepare a large-scale and multi-class data set, which is unlikely. Secondly, the deep learning method has high computing power requirements, which means high deployment costs, and it is unlikely to be applied on a large scale.
[0026] (4) The method of the present invention is simple, efficient, and easy to deploy. It can be deployed on any surveillance camera to realize partial intelligent monitoring functions. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 is the set convolutional coding template image;
[0028] Figure 2 It is the algorithm flow chart;
[0029] Figure 3 This is an experimental comparison chart with other methods. DETAILED DESCRIPTION
[0030] The specific implementation methods of the present invention are given below. It should be noted that the present invention is not limited to the following specific embodiments, and all equivalent changes made on the basis of the technical solution of this application fall within the protection scope of the present invention.
[0031] First, let’s explain the technical terms that appear in this plan:
[0032] RGB: three color channels: red (R), green (G), and blue (B).
[0033] In this embodiment, a moving target detection method based on convolutional coding is disclosed, comprising the following steps:
[0034] Step 1: Collect a color video to be detected, wherein the color video to be detected includes M frames of images, where M is a positive integer;
[0035] Step 2: Establish a three-channel convolutional coding template, the size of the three-channel convolutional coding template is N×N×3 and N∈[6,8,10], the three-channel convolutional coding template includes two left and right sub-templates, the size of the sub-template is N / 2×N / 2×3, the weights of the three channels of each pixel in the left sub-template are all negative, the weights of the three channels of each pixel in the right sub-template are all positive, and the absolute value of the sum of the weights of the three channels of each pixel in the left and right sub-templates is
[0036] Step 3: Input the color video to be detected frame by frame into the three-channel convolutional coding model obtained in step 2 for encoding, output the encoding result of each frame of the image frame by frame, screen frame by frame according to the encoding result of each frame and mark the area where the moving target exists in each frame;
[0037] Among them, for the mth frame, m∈[1,M], the encoding result of the mth frame image is a digital sequence obtained by subtracting the digital sequence obtained by encoding the m-1th frame image and the digital sequence obtained by encoding the mth frame image. When m=1, the encoding result of the 1st frame image is the digital sequence obtained by encoding the 1st frame image. When screening according to the encoding result of the mth frame, the value less than the threshold in the encoding result of the mth frame image is screened out, and the convolution area corresponding to the value less than the threshold in the encoding result of the mth frame image is marked as the moving target existence area of the m+1th frame.
[0038] After analyzing a large number of shadow areas, it was found that the shadow areas appear on the picture as large areas of pure black with the same brightness, that is, the values of all pixels in this area on the BGR channel are very close or even completely equal. Through the convolutional coding template designed by the invention, these shadow areas will be encoded as a string of digital sequences close to zero.
[0039] Specifically, the weights of the three channels of each pixel in step 2 include an average scheme or a proportional distribution scheme, where the average scheme is that the weights of the three channels of each pixel are The proportional allocation scheme allocates the weights of the three channels of each pixel according to the proportion of the values of each channel in the three channels of each pixel.
[0040] Specifically, in step 2, N=6. As the value increases, the anti-interference ability is enhanced, but the ability to detect small moving targets is weakened. Therefore, 6×3 is the optimal value obtained from multiple experiments.
[0041] Specifically, N=6, that is, the weight of each pixel on the BGR channel is 1 / 27, and the sum of the weights on the three RBG channels is 1 / 9, ensuring the principle of left negative and right positive. The sum of all weights in the left sub-region is -1, and the sum of all weights in the right sub-region is 1.
[0042] Specifically, in step 3, when performing the convolution operation, the convolution step size is set to (6, 3), the padding operation is to copy the outermost pixels of the current image frame, and the obtained convolution result is expanded into a series of digital sequences.
[0043] Specifically, in step 4, the threshold value is 5-10.
[0044] In this embodiment, a moving target detection system based on convolutional coding is disclosed, including a data acquisition module, a three-channel convolutional coding template, a coding module and an output module;
[0045] The data acquisition module is used to acquire the color video to be detected, and the color video to be detected includes M frames of images, where M is a positive integer;
[0046] The size of the three-channel convolutional coding template is N×N×3 and N∈{6, 8, 10}, the three-channel convolutional coding template includes two left and right sub-regions, the size of the sub-region is N / 2×N / 2, the weights of the three channels of each pixel in the left sub-region are negative, the weights of the three channels of each pixel in the right sub-region are positive, and the absolute value of the sum of the weights of the three channels of each pixel in the left and right sub-regions is
[0047] The encoding module is used to input the color video to be detected into the three-channel convolutional encoding model frame by frame for encoding, and output the encoding result of each frame of the image in sequence, wherein the encoding result of the first frame of the image is a digital sequence obtained by encoding the first frame of the image, and the encoding result of the Mth frame of the image is a digital sequence obtained by subtracting the digital sequence obtained by encoding the M-1th frame of the image and the digital sequence obtained by encoding the Mth frame of the image;
[0048] The output module is used to screen each frame of the color video to be detected in turn and mark the area where the moving target exists in each frame; wherein, when screening the encoding result of the current frame image, the value less than the threshold in the encoding result of the current frame image is screened out, and the convolution area corresponding to the value less than the threshold in the encoding result of the current frame image is marked as the area where the moving target exists in the next frame.
[0049] Preferably, the moving target detection system based on convolutional coding can be arranged in a local data storage and processing unit of the camera to realize a part of the intelligent monitoring function.
[0050] Specifically, the moving target detection system in this embodiment can be applied to the field of autonomous driving. Different from traditional detection models such as GMM and KNN, the processing algorithm greatly saves computing costs. For target areas with shadows, the detection accuracy is very high, which meets the dual pursuit of computing speed and accuracy in autonomous driving. At the same time, the moving target detection system in this embodiment can be applied to the field of intelligent transportation. In the public security system, it can provide real-time recognition and capture functions for surveillance cameras, and has the prospect of large-scale application.
[0051] Example 1
[0052] In this embodiment, a moving target detection method based on convolutional coding is disclosed. Four videos of different scenes are selected as detection objects. There are a lot of shadow interferences in these four videos, such as Figure 3 As shown, the overall detection accuracy and speed comparison table is shown in Table 1 and Table 2. From the results, we can see that compared with other methods, this method hardly detects shadows as moving targets. In addition, this method has obvious improvements in speed and accuracy.
[0053] It can be seen from the experimental results in this embodiment that the present invention can improve the detection accuracy. The convolution template designed by the present invention takes into account the problem of sudden brightness changes that may occur in actual situations. Since the brightness changes in a certain area remain consistent, the convolution template uses the principle of left negative and right positive to offset this change. In addition, the 6×6×3 convolution template has the effect of mean filtering and eliminates the influence of noise to a certain extent. Finally, the convolution template of this article solves the big problem of shadow interference in moving target detection. These three advantages make the method of this article have improved accuracy.
[0054] The processing speed comparison table and detection accuracy comparison table of this method and the current mainstream algorithm are as follows:
[0055] Table 1 Detection speed comparison table;
[0056]
[0057] Table 2. Comprehensive accuracy Fmeasure comparison table
[0058]
[0059] Taking the video of Highway-I as an example, we select the mean weight template as Figure 1 First, the first frame of the video is convolutionally encoded to expand into a series of digital sequences, and then the next frame is convolutionally encoded to obtain a series of digital sequences. The digital sequence of the next frame is subtracted from the digital sequence of the previous frame to obtain the result sequence. In this video, we set the threshold to 5, that is, all convolution areas in the result sequence that are less than 5 are areas where moving targets exist.
Claims
1. A moving target detection method based on convolutional coding, characterized in that: The steps include: Step 1: Collect a color video to be detected, wherein the color video to be detected includes M frames of images, where M is a positive integer; Step 2: Establish a three-channel convolutional coding template, the size of the three-channel convolutional coding template is N×N / 2×3 and N∈[6,8,10], the three-channel convolutional coding template includes two left and right sub-templates, the size of the sub-template is N / 2×N / 2×3, the weights of the three channels of each pixel in the left sub-template are negative, the weights of the three channels of each pixel in the right sub-template are positive, and the absolute value of the sum of the weights of the three channels of each pixel in the left and right sub-templates is Step 3: Input the color video to be detected frame by frame into the three-channel convolutional coding model obtained in step 2 for encoding, output the encoding result of each frame of the image frame by frame, screen frame by frame according to the encoding result of each frame and mark the area where the moving target exists in each frame; Among them, for the mth frame, m∈[1,M], the encoding result of the mth frame image is a digital sequence obtained by subtracting the digital sequence obtained by encoding the m-1th frame image and the digital sequence obtained by encoding the mth frame image. When m=1, the encoding result of the 1st frame image is the digital sequence obtained by encoding the 1st frame image. When screening is performed based on the encoding result of the mth frame, the value less than the threshold in the encoding result of the mth frame image is screened out, and the convolution area corresponding to the value less than the threshold in the encoding result of the mth frame image is marked as the moving target existence area of the m+1th frame.
2. The moving target detection method based on convolutional coding as claimed in claim 1, characterized in that: The weights of the three channels of each pixel in step 2 include an average scheme or a proportional distribution scheme, where the average scheme is that the weights of the three channels of each pixel are The proportional allocation scheme allocates the weights of the three channels of each pixel according to the proportion of the values of each channel in the three channels of each pixel.
3. The moving target detection method based on convolutional coding as claimed in claim 1, characterized in that: In step 2, N=6.
4. The moving target detection method based on convolutional coding as claimed in claim 1, characterized in that: In step 4, the threshold value is 5-10.
5. A moving target detection system based on convolutional coding, characterized in that: It includes a data acquisition module, a three-channel convolutional coding template and an output module; The data acquisition module is used to acquire the color video to be detected, and the color video to be detected includes M frames of images, where M is a positive integer; The size of the three-channel convolutional coding template is N×N / 2×3 and N∈[6,8,10]. The three-channel convolutional coding template includes two left and right sub-templates. The size of the sub-template is N / 2×N / 2×3. The weights of the three channels of each pixel in the left sub-template are all negative. The weights of the three channels of each pixel in the right sub-template are all positive. The absolute value of the sum of the weights of the three channels of each pixel in the left and right sub-templates is The output module is used to encode the color video to be detected frame by frame using a three-channel convolutional coding model, output the coding result of each frame of the image frame by frame, and perform frame by frame screening according to the coding result of each frame and mark the area where the moving target exists in each frame; Among them, for the mth frame, m∈[1,M], the encoding result of the mth frame image is a digital sequence obtained by subtracting the digital sequence obtained by encoding the m-1th frame image and the digital sequence obtained by encoding the mth frame image. When screening according to the mth frame encoding result, the value less than the threshold in the encoding result of the mth frame image is screened out, and the convolution area corresponding to the value less than the threshold in the encoding result of the mth frame image is marked as the moving target existence area of the m+1th frame.
6. The moving target detection system based on convolutional coding as claimed in claim 5, characterized in that: The moving target detection system based on convolutional coding can be arranged in a local data storage and processing unit of the camera.
