A detection algorithm, based on the combined local-global (CLG) optical-flow model and Gaussian pyramid for a moving target appearing against a dynamic background, can compensate for the inadaptability of the classic Horn–Schunck algorithm to illumination changes and reduce the number of needed calculations. Incorporating the hypothesis of gradient conservation into the traditional CLG optical-flow model and combining structure and texture decomposition enable this algorithm to minimize the impact of illumination changes on optical-flow estimates. Further, calculating optical-flow with the Gaussian pyramid by layers and computing optical-flow at other points using an optical-flow iterative with higher gray-level points together reduce the number of calculations required to improve detection efficiency. Finally, this proposed method achieves the detection of a moving target against a dynamic background, according to the background motion vector determined by the displacement and magnitude of the optical-flow. Simulation results indicate that this algorithm, in comparison to the traditional Horn-Schunck optical-flow algorithm, accurately detects a moving target undergoing illumination changes against a dynamic background and simultaneously demonstrates a significant reduction in the number of computations needed to improve detection efficiency.
As research in the computer vision field advances, achieving progress in one of its most significant and widespread applications, dynamic background moving target detection, is imperative. The optical-flow method has proven to be essential for detecting and analyzing a moving target against a dynamic background [1, 2]. The optical-flow method possesses the advantages of high detection precision and the capacity to detect sheltered targets. Developed and refined over the course of 30 years, the optical-flow method is widely applied in the field of image analysis. The concept of optical-flow was proposed by Gibson in 1950. In a video image, the grayscale of each pixel in the image is changed in time sequence, the relationship of the changes of each pixel can be used to determine the relative motion, thus detecting a moving target in the video image. The fundamental principle of the optical-flow method entails projecting each pixel in a video image sequence onto a three-dimensional (3D) object, assigning an equivalent velocity vector for each projection, and then processing a dynamic analysis of the 3D object using a velocity vector feature [3-5]. The optical-flow field in a video frame is continuous when there is no relative movement between target and background; otherwise, it is discontinuous. Therefore, accessing continuous conditions of an optical-flow field in a video image enables detection of a moving target within that image.
Differential-based optical-flow and matching-based optical-flow algorithms are the most studied current optical-flow methods. The basic constraint equation rests on a differential optical-flow algorithm derived from the assumption of brightness constancy. According to differing constraint conditions, this paper presents two representative algorithms, the Horn-Schunck (HS) global optical-flow algorithm [6, 7] and the Lucas-Kanade (LK) local optical-flow algorithm [8, 9]. Based on the hypothesis of global smoothness, the HS global optical-flow algorithm computes the optical-flow of each point in a video image sequence [10]. Thus, the optical-flow acquired in this algorithm exhibits high density. In contrast, the LK algorithm, by assigning different weight values to the points in the neighborhood of the central point in a video image, computes the optical-flow at the central point using the weighted optical-flow of points in that neighborhood [11]. Thus, this algorithm requires a relatively sparse optical-flow. Based on matching algorithms [12, 13], optical-flow is defined by the displacement generated by a moving target fitting from different times. Typical methods calculate optical-flow by minimizing distance functions or maximizing cross-correlation functions [14].
In this paper, an improved combined local-global (CLG) optical-flow model used for moving targets in dynamic background detection is studied, this improved algorithm solves the problem that when applying a classic optical-flow algorithm to illuminate change condition, the optical-flow field is unreliable. Further combinations of the HS and LK optical-flow algorithms ensure the reduction of the amount of computation required to complete real-time detection of a moving target undergoing changing illumination against a dynamic background.
2.1. Improved Optical-flow Algorithm
Optical-flow algorithms are well adapted to detect moving targets with moving cameras. These algorithms possess the advantages of using image information for calculations that do not need pre-processing or the ability to process sheltered targets. Two problems remain unsolved when applying the classic HS and LK optical-flow algorithms to practical applications. First, due to illumination changes, the hypothesis of brightness constancy is not applicable in certain areas. Thus, the optical-flow fields calculated in those areas are not reliable [15]. Second, classic algorithms, despite employing simple principles, require large amounts of computation and thus, cannot achieve real-time detection in some special circumstances [16].
2.2. Improvement to Adapt Illumination Change
The classic HS optical-flow algorithm is based on the hypothesis of brightness constancy. The basic optical-flow constraint equation is
where
where
Lucas, a contemporary of Horn, proposed a new optical-flow model based on the hypothesis of keeping the optical-flow velocity vector constant across a small area
where
To combine the advantages of the HS and LK optical-flow algorithms, Bruhn and his team proposed the CLG optical-flow model [17]:
Despite possessing the merits of both the HS and LK optical-flow algorithms, the CLG optical-flow model rests on the hypothesis of brightness constancy and, therefore, cannot adapt to illumination changes to achieve moving target detection.
To solve this problem, an improved CLG optical-flow model is proposed. To reduce the sensitivity to illumination changes in this model, a new data term is adopted. This term is a combination of gradient conservation hypothesis and traditional CLG optical-flow model. Its energy equation is as follows:
where
Under the condition in which one conservation hypothesis is not valid, to ensure an acceptable result after performing computations, both grayscale conservation and gradient conservation are considered to yield an improved energy equation, where
Restraining the effective illumination change enhances the performance of the algorithm; a structure and texture decomposition method is performed on video image sequences as a form of pre-processing. Input video image can be decomposed to texture information section
where
Then, treating Eq. (6) and Eq. (8) as a system of simultaneous equations produces
According to the grayscale linear-invariance hypothesis, Eq. (9) is correct when
in which
The improved CLG optical-flow algorithm solved the problem of low computing accuracy in optical-flow algorithms under conditions of changing illumination. It could not, however, achieve real-time moving target detection, because a certain number of iterations are required to meet the demand of high accuracy and such numbers of iterations need a large amount computation which consumes a long time. This study presents improvements aimed at reducing the needed amount of computation while simultaneously satisfying the system’s requirement of providing real-time detection.
2.3. Improvements to Reduce the Amount of Computation
To complete real-time moving target detection, the threshold segment method was adopted. In this method, the optical-flows of points whose grayscale gradient value was greater than the threshold were calculated using the improved CLG optical-flow algorithm in 2.2. Then, the optical-flows of other points were calculated by iterations. Next, the multi-layer Gaussian pyramid layered computational method was adopted and adjusted to the size of the image to reduce the amount of needed computation and to yield real-time detection.
The grayscale values of the pixel points generally remained the same after the target moved. This observation is approximately true when considering large grayscale gradient points. Therefore, when applying the improved CLG optical-flow algorithm to large gradient points only, iterations of the algorithm to other points does not affect the accuracy of the algorithm.
The weight function can be defined by
where T is the threshold. Correspondingly, Eq. (6) then can be changed to
The optical-flow iteration formula for small grayscale points is
where
Then, a Gaussian low-pass filter (GLPF) and image convolution method were adopted to process down-sampling two times to generate a three-layer Gaussian pyramid. For pixel points in the image, the bottom layer of the Gaussian pyramid was defined by
For low layers of the Gaussian pyramid, with fewer pixel points in an image, the optical-flow precision can be raised by increasing the number of iterations; for high layers of the Gaussian pyramid, the real-time performance of the algorithm can be improved by decreasing the number of iterations. Several frames of video images were selected and processed using the above-described algorithm. Table 1 summarizes a comparison of the computation times required for performing 100 iterations on eight separate video images both before and after implementing the improved algorithm.
[TABLE 1.] Comparison of computation times before and after implementing improved algorithm
Comparison of computation times before and after implementing improved algorithm
2.4. Moving Targets in dynamic background detection
To detect the direction in which an image background is moving, a sliding window was established under polar coordinates to detect a moving vector based on the optical-flow calculated using the algorithm proposed in 2.3. The sliding window was fan-shaped, with a top angle of π/6. The position of the fan-shape was defined by the direction of the angular bisector of
Statistics characterizing the moving background vectors can be obtained from the amplitude of the motion vector
where
To test the validity of the algorithm designed to detect a moving target undergoing changes in illumination against a dynamic background, we utilized a computer with 2GB of memory and an Intel Pentium 2.60 GHz processor to complete MATLAB simulation experiments. The images in Fig. 2 depict the results of video detection performed on David, the subject. The video included 770 frames; each frame was 320 × 240 pixels.
In contrast to the HS optical-flow algorithm, the B&A brightness constancy model adapts to illumination change, provides a better experimental result, thus is used as a comparison with algorithm proposed in this paper. Figure 2 illustrates that under dramatic illumination changes, this improved algorithm can generate optical-flow fields and optical-flow vectors to distinguish the moving target more clearly. It also can maintain the optical-flow in the same direction as the moving target. Thus, the problem posed by the inability of the traditional optical-flow algorithm to adapt to illumination changes is solved in this study. The improved algorithm achieves high-precision detection of a target undergoing illumination changes and moving against a dynamic background.
To verify further the effectiveness of this algorithm, comparison experiments of this and another algorithm are practiced using an ECSSD (Extended Complex Scene Streams Dataset) standard database. PR curves of these algorithms are shown in Fig. 3. It can be seen that this algorithm showed higher accuracy and recall rate.
This paper presents an improved CLG optical-flow model combining the Gaussian pyramid and structure and texture decomposition methods. In contrast to the classic optical-flow algorithm, this improved algorithm adapts to illumination changes, reduces the amount of required computation, and performs real-time detection. To satisfy the requirements for making practical use of real-time detection, this algorithm utilizes a combination of a Gaussian low-pass filter and an image convolution method, decreasing the average time consumed to perform 100 iterations from 561.2 ms to 76.6 ms. Simulation experiments show that the optical-flow algorithm proposed in this study completes high-precision moving-target detection in conditions with changing illumination and dynamic backgrounds and performs real-time detection, thus satisfying the practical demands for engineering applications.