Abstract
Nowadays, moving object detection in sequence images has become a hot topic in computer vision research, and has a very wide range of practical applications in many fields of military and daily life. In this paper, fast detection of moving objects in complex background is studied, and fast detection methods for moving objects in static and dynamic scenes are proposed respectively. Firstly, based on image preprocessing, aiming at the difficulty of feature extraction of moving targets in low illumination at night, Gamma change is used to process. Secondly, for the fast detection of moving objects in static scenes, this paper designs a detection method combining background difference and edge frame difference. Finally, aiming at the fast detection of moving objects in dynamic scenes, a feature matching detection method based on the SIFT algorithm is designed in this paper. Simulation experiments show that the method designed in this paper has good detection performance.
Introduction
The automatic detection technology of moving objects has always been a hot and challenging problem in the field of computer vision. This technology combines image processing, automatic control, information science and other technologies organically, and becomes the bottom key technology of many computer vision systems in practical engineering applications. Such as precision strike weapon guidance system, computer-aided driving system, missile terrain and map matching system, industrial pipeline automatic monitoring system, intelligent room, intelligent robot, medical image system, intelligent transportation system [1, 2] and so on.
As the visual basis of human perception of the world, image is an important means for humans to obtain information, express information and transmit information. Image technology [3] is a general term for various image-related technologies. Its main content is a series of work on digital images using computers and other electronic devices. Image technology is divided into three levels according to the processing method, degree of abstraction and amount of data: image processing, image analysis [4] and image understanding.
Image-based target detection is a complex process, and the difference in the application environment and algorithm scheme will greatly affect the target detection effect [5]. With the further development of image technology and the need for Engineering applications, the effective detection of interesting objects in sequence images by using advanced digital image technology has become the difficulty of image detection technology research. The purpose of moving object detection based on a sequence image is to separate the moving area from the background area in the image sequence. Since the development of the theory of moving object detection in sequential images, many different methods of target detection have been proposed. Common algorithms include optical flow method [6, 7], image difference method [8], extended EM algorithm [9, 10], wavelet transform-based method [11], motion energy detection method [12], and artificial neural network-based method [13, 14]. There are three classical detection algorithms: optical flow method, inter-frame difference method [15] and background difference method [16].
Based on the above background, this paper uses Gamma change to process the sequence image based on image preprocessing, and then proposes corresponding fast detection methods for moving objects in static and dynamic environments respectively. The specific contributions of this paper are as follows. Based on image preprocessing, because of the difficulty of feature extraction of moving targets in low illumination at night, Gamma change is used to process. Aiming at the fast detection of moving objects in static scenes, a detection method combining background difference and edge frame difference is designed in this paper. Aiming at the fast detection of moving objects in dynamic scenes, this paper designs a detection method based on SIFT algorithm feature matching, which has good performance.
Fast detection method of moving object
Sequence image preprocessing
Grayscale transformation of image
After graying, each pixel of the color image has only 256 gray values. In the process of using the algorithm and processing, it can reduce the storage space, reduce the amount of calculation, improve the speed of image processing and ultimately improve the speed of moving object detection. The color image can be transformed into a gray image according to formula (1).
Among them, Y is calculated according to the relationship between R, G, B color components and brightness signal Y in YUV. R, G and B represent red, green and blue components respectively. The weighting coefficients of three colors, red, green and blue, are affected by the color component signals.
The specific method is as follows. If the input image is f (x, y) and the output image is F (x, y), a threshold T is usually selected. The binary transformation function expression of the image is shown in formula (2).
The threshold T divides the image F (x, y) into two parts. In this paper, the pixels larger than T are set to white (target object) and the areas smaller than T are set to black (background).
The definition of one-dimensional median filtering is shown in formula (3), pp.
Among them, med means median operation on the pixels in the image. In the above formula, 2 N + 1 pixel are sorted, and the final output pixel is the median of the pixel sequence.
Similarly, two-dimensional pixel matrices represent two-dimensional images, and two-dimensional median filtering is suitable for two-dimensional pixel matrices. The definition of two-dimensional median filtering is given in the following formula:
In this paper, Gamma transform enhancement is used as the method of low illumination processing: the average value of the original image is adjusted to 0, and the variance is adjusted to 1. According to the distribution histogram distribution characteristics, the current image is judged to be of high light or low light type, and the initial fine adjustment of the gray level is performed according to the corresponding type, and the image is corrected by Gamma. Because there are few cases of excessive light intensity in the natural traffic environment, this paper only considers the dark situation. The transformation formula is shown in formula (5), pp.
The method used in this paper uses a mapping method for all points of the image, so there will be no local over-darkness or over-brightness.
Background difference detection method
Our method is used to segment the background and foreground. Formula (6) is used to process each pixel of a differential image Sub _ image.
For the Ostu method, the probability distribution w0 = 0 at the gray value of “0” should be considered. Threshold TH divides the image pixels into C0 = (0, 1, ⋯ , TH) C1 = (TH + 1, TH + 2, ⋯ , L - 1) and categories, representing the target and background respectively.
After moving target detection, there may be false targets. To solve this problem, the left, right, upper and lower parts of each connected domain are saved in memory. For each domain, the following comparisons are made with other domains:
The specific steps are as follows:
1) Gauss filtering: The image is filtered by a two-dimensional Gauss function. The variance δ of two-dimensional Gauss function depends on experience. The two-dimensional Gauss function is:
For a gray image, the filtering process is equivalent to the convolution process, which is described as follows:
2) x, y direction gradient: image Filter (x, y) is a 2-D discrete matrix, and then the first derivative of x and y direction is obtained. That is to say, the first-order differential is solved in the discrete. Based on this, the gradient in the direction of x and y is solved as follows:
3) Total gradient at (x, y): To simplify the computational inconvenience caused by the two gradients in the x y and directions, it is necessary to take the total gradient of the pixel (x, y) as shown in formula (11), pp.
Assuming that there are moving objects in the monitoring scene, the motion contour information of moving objects can be obtained by the difference between adjacent frames. To obtain more reliable contour information, it is undoubtedly a feasible method to use the difference between the adjacent three frames. At the same time, to avoid the influence of noise on the detection results, it is possible to use the edge information of the image and the three-frame difference method to realize the detection of moving objects in the monitoring scene, that is, to form a three-frame difference method based on the edge information. The edge segmentation results obtained by the three-frame difference method based on edge information and the results of moving object detection based on background difference are calculated reasonably, that is to say, the problem of clothing dividing the human body into multiple or multiple moving objects is solved to a certain extent. This scheme not only ensures the rapidity of detection, but also reduces the false detection rate of moving objects in complex monitoring scenarios. The specific implementation process is shown in Fig. 1.

Flow chart of detection method combining background subtraction and edge inter-frame subtraction.
The details of this method are described in detail below.
1. Feature point extraction
Based on the good performance of the SIFT algorithm, this paper uses the SIFT algorithm to extract features. The process can be divided into four steps: detecting scale-space extremum points, accurately locating extremum points, specifying direction parameters for each key point and generating feature point descriptors: detection of extremum points in scale space, accurate positioning of extremum points, specify orientation parameters for each key point, generation of feature point descriptors
2. Feature matching
In this method, a feature-based matching method is used. When the SIFT feature vectors of two images are generated, the Euclidean distance of the key point feature vectors is used as the similarity measure of the key points in two images.
3. Correction of matching pairs of feature points
This paper proposes a strategy of eliminating pseudo-feature points.
In the first step, all feature matching pairs extracted are substituted into the least squares formula to obtain the affine parameter (A1, B1).
In the second step, the coordinate (x, y) of the feature points in the reference frame is matched and the estimated coordinate position (x″, y″) of the feature points in the current frame is calculated according to the affine parameter (A1, B1). If the Euclidean distance between the coordinates (x′, y′) (x″, y″) and of the feature points matched with (x, y) in the current frame exceeds a certain threshold T1, the matching pair is considered to contain false feature points, and the matching pair is eliminated.
In the third step, the least-squares affine parameter solution (A2, B2) is calculated by using the feature matching pairs left behind in the second step. Repeat the second step, but the threshold is T2.
In the fourth step, the least-squares affine para-meter solution (A3, B3) is calculated by using the remaining feature matching pairs.
By reasonably adjusting the values of T1 T2 and, the purpose of eliminating false feature points can be achieved.
4. Motion compensation
Because bilinear interpolation has high accuracy, can achieve smoothness between pixels, there will be no mosaic phenomenon, so this paper uses the bilinear interpolation method.
5. Background subtraction
The variation of illumination and the estimation of affine parameters may also cause errors. In practice, there is a large amount of noise in the differential image, so it is necessary to threshold the difference image to eliminate the noise.
Summary of article methods
Aiming at the sequence images collected in this paper, based on fully studying the algorithms of moving object detection summarized by predecessors, appropriate detection methods are proposed based on static and dynamic environments respectively to achieve accurate detection of moving objects.
The main steps of this method are as follows: Aiming at moving object detection in a static environment, this paper designs a detection method combining background difference and edge frame difference, and its implementation process is shown in Fig. 2. Aiming at moving target detection in a dynamic environment, this paper designs a detection method based on SIFT algorithm feature matching, and its implementation process is shown in Fig. 3.

Moving target detection flow chart in a static environment.

Moving object detection flow chart in a dynamic environment.
Figure 4 shows the sequence images collected in this paper. Before detecting moving targets, the images need to be preprocessed to avoid interference of equipment and environmental factors on subsequent moving target detection.

Original image.
Firstly, the image is grayed. The result of gray processing is shown in Fig. 5. From the figure, we can see that the gray processing can reduce the dimension of the three-dimensional image to two dimensions, but the contour of the image and the moving object has not changed.

Grayscale processing.
After grayscale processing, the overall illumination of the image is still very low. Therefore, Gamma transform is used to process the image. The processing results are shown in Fig. 6. From the figure, we can see that the overall illumination of the image has been improved, and the illumination of the target has been improved obviously, which effectively reduces the impact of low illumination on the subsequent image processing.

Low illumination processing.
In the process of sequence image acquisition, there is inevitably noise generated by equipment and environmental influences, so it is necessary to denoise the image. Figure 7 is the image with salt and pepper noise, and Fig. 8 is the image after median filtering. It can be seen that the filtering process significantly reduces the interference of salt and pepper noise to the image [17].

Image with noise.

Filtered image.
The image includes target, background and noise. After noise filtering, it is necessary to separate the target from the background to make the moving object more prominent. Binarization is a method to separate the foreground target pixel from the background pixel in the image. The result of binarization is shown in Fig. 9. As can be seen from the figure, most of the background and moving objects are distinguished successfully by binary processing, so it can be known that binary processing is an important step in the process of moving object detection.

Binarized image.
After preprocessing, this paper first tests the combined background difference and edge inter-frame difference motion detection method in the static environment designed in this paper, and analyzes the performance of the method. The method of this paper is compared with the classical background difference method and the interframe difference method. The comparison results are shown in Table 1.
Performance analysis of moving target detection method in a static environment
From Table 1 and Fig. 10, we can see that the proposed motion detection method combining background difference and edge frame difference can combine the advantages of background difference and frame difference, and enhance their respective advantages, so that the two methods can be well combined. Compared with the background subtraction method and the inter-frame subtraction method, the correct detection rate is 96.3%, and the false detection rate is 1.3%.

Comparison of method performance before and after improvement under static environment.
Secondly, the moving target detection method based on SIFT feature matching in the dynamic environment designed in this paper is tested, and the performance of this method is analyzed. Comparing the proposed method with the block matching method and the wavelet transform method, the comparison results are shown in Table 2.
Performance analysis of moving target detection methods in a static environment
Combining Table 2 and Fig. 11, we can see that compared with block-matching and wavelet transform, the performance of the proposed method has improved significantly in three aspects: correct detection rate, false detection rate and processing time. Among them, the correct detection rate of this method is 92.7%, the false detection rate is 1.9%, and the processing time is 7.2 seconds.

Comparison of method performance before and after improvement in dynamic environment.
Nowadays, as the key technology of computer vision and intelligent video surveillance systems, moving object detection has become more and more important. It has been widely used in many fields and contains tremendous energy. It has also attracted the attention and research of many scholars. But up to now, there are still many problems that cannot be solved well in moving object detection in sequence images. To detect moving targets quickly and accurately, this paper proposes corresponding methods for static and dynamic environments in a complex background. Gamma transform is added to image preprocessing to process low illumination images, which can effectively improve the quality of images. Then a detection method combining background subtraction and edge inter-frame subtraction is proposed for a static environment. Because of the dynamic environment, a method of feature matching detection based on the SIFT algorithm is proposed. Finally, the proposed method is tested separately. By comparing with other methods, the good performance of the proposed method is illustrated, which proves that the proposed method can detect moving targets effectively and timely in their respective environments.
Funding
This work was supported by Chongqing Big Data Engineering Laboratory for Children, Chongqing Electronics Engineering Technology Research Center for Interactive Learning, the Science and Technology Research Project of Chongqing Municipal Education Commission of China (KJ1601401), the Science and Technology Research Project of Chongqing University of Education (KY201725C), Basic Research and Frontier Exploration of Chongqing Science and Technology Commission (CSTC2014jcyjA40019), Project of Science and Technology Research Program of Chongqing Education Commission of China. (KJZD-K201801601)
