Improved Video Moving Target Tracking Based on Camshift

Focusing on the failure under the condition of target blocking, the similarity between target color and background color for the Camshift algorithm, an improved algorithm based on Camshift algorithm is proposed. Gaussian mixture model is used to determine the tracking area fast and accurately because it is not sensitive to the external conditions such as light and shadow. Kalman predictor is used to predict the blocked target effectively. The video is processed in the MATLAB environment. The moving target can be tracked and its position can be predicted accurately with the proposed improved algorithm. The results verify the feasibility and effectiveness of the algorithm.


Introduction
Intelligent video processing technology is used in not only the target detection and identification but also tracking, behavior analysis and other aspects of the daily life.The target motion tracking technology has been widely applied in industrial production, traffic management, military and so on.Bradski proposed the improvement [1] of the continuous mean shift and then applied it to the target tracking.What's more, Camshift is improved in amount situations when the tracking target is heavily sheltered [2] or similar to the environment background in the same hue.Due to the requirement of the initialization manually for Camshift tracking, Wu D [3] proposed the use of interframe difference algorithm with low computational complexity and motion prediction based on the previous moment to achieve the effective target tracking in the occlusion.
The algorithm can detect the uniform moving object with occlusion, but it failed to take the changes of the actual background environment and state of the tracking object into considerations.Xiu C [4] proposed the use of the weighted saliency to suppress the similarity interference from the background, and identified the target by the reverse probability projection, but did not take target occluded into account.Many scholars take Kalman prediction [5] [6] to estimate the target position which improves the accuracy of the tracking results.Xia J [7] proposed the combination of two-frame-difference and Camshift to track the target.But with the change of the background and illumination, the foreground is hard to recognize and so is the occluded target.Tang Q [8] proposed the difference method to obtain the target without considering the similarities among the elements easily confused.
Focusing on the issues above, an improved algorithm has been proposed to deal with the background and occluded target.Because of the robustness of illumination and small shiver, Gaussian Mixture Model (GMM) can detect the moving target precisely.Although frame difference can detect the changes between the frames, the small vibration will be the most difficult issue.GMM considers the statistical probabilities of the background rather than the color, frame difference and other details of the textures.Kalman prediction can calculate the position of the moving target whether it is occluded or not.

Camshift Algorithm
Since the target histogram is easily affected by the change of the color and illumination, Camshift (Continuously Adaptive Meanshift) algorithm is based on the HSV color space to represent the object.After calculating the component Hue probability distribution and then locating the centroid of the tracking target, the center of the tracking window will adjust to the range of the tracking target by several iterations.Thus we keep track of the target [9] [10].
The implementation steps of the Camshift algorithm are as follow: 1) The component Hue in the HSV color space is extracted from the current video frames.This will further be used to generate the probability histogram by the color histogram in order to set the tracking window.
2) According to the probability distribution, the zero and first order moments of the image in the tracking window are calculated: And then take the Equation ( 1), ( 2) and (3) into Equation (4) separately.3) The fixed tracking window in the Meanshift algorithm has been improved in the Camshift algorithm.The tracking window size is reset according to the pixel probability distribution in the current window, and then the center position of the tracking windows adjusts to the current centroid.This iteration will be stopped until the difference between center and centroid is less than a certain threshold.
4) The step 2 and step 3 are repeated until the difference is less than the set threshold or the iterations times exceed the threshold.

Foreground Extraction Based on GMM
As component H in the HSV color space contains the image information, the background change has an effect on the tracking window.GMM which is robust to illumination, small vibration and so on can be used to extract the foreground information.What's more, GMM can reduce the tracking failure caused by the similarity to the background color.
, , 2π where ( ) is the covariance of the t th component.
Every object merged in the scene will be decided whether belongs to the foreground or not.The time the process spends will take a long time depending on the number of the Gaussian distribution and learning rate.To alleviate the problem, the idea is to set different number of Gaussian distribution for different region.The region getting close is described by 3 Gaussian distribution while the region far away is described by 1 Gaussian distribution.The learning rate is the strength of the adjustment in the dynamic changes.Considering the estimation accuracy, the original model parameters are improved to adapt to the change better [11] [12]. , Here, α is the learning rate.

Kalman Prediction
The moving target can be described by the current position and velocity in the time domain [13] [14].Kalman prediction can accurately predict the coming state of motion and position information, even the target is occluded, and avoids the similar color shift after the median filter algorithm.The sample time is discrete actually in the target tracking system.It is assumed that the tracking target makes uniform linear motion in a relatively short time, and linear analysis is applied to its motion in discrete time.The Kalman prediction can be expressed as follow: where the Equation ( 11) is the state prediction which predicts the current state according to last moment information.A(k) is the state transition matrix, B(k) is the control matrix, and U(k) is the control element.The Equation ( 12) is state observation process to get the current best estimation.

D k P k H HP k H R
where P 1 (k) is the covariance in the prediction process.P(k) is the covariance in the observation process.Q is the model prediction noise.Z(k) is the observation value.H is the observation matrix.V is the model observation noise.R is the covariance of V. D(k) is the Kalman coefficient which is used to adjust the confidence between prediction and observation.The specific steps of our proposed algorithm are shown in Figure 1.

Experiment
We evaluate our approach on the 640 × 480 pixels video.The yellow rectangular indicates the motion target by our approach and the green one shows by Camshift algorithm.The experimental hardware platform processor is Pentium Dual-Core 2.5 GHz, 2 GB memory.Improved GMM is used to extract foreground information more quickly and precisely, and thus locate the tracking target in the scene rapidly.Besides, it avoids the effects of the similarity color between the target and background.From the figures above, the tracking target has the similar color to the shelter.With The improved GMM, it is the book extracted from the foreground rather than the illumination or other textures.Then, the centroid, moving direction and velocity is calculating by Camshift.In Figure 2, the original Camshift tracking detect the object, but it had some area undetected.Our proposed algorithm can detect the whole object by foreground extraction algo-rithm by improved GMM.After the detecting the tracking target, original Camshift algorithm lost the tracking of the target because of the shelter in Figure 4. Ours can still predict the target's position by Kalman prediction.Finally, both original Camshift algorithm and ours can detect the tracking target in Figure 6.Nevertheless, ours has more stable and accurate tracking performance than original Camshift algorithm even without the occlusion.

Outlook and Conclusion
We have presented an efficient improved algorithm based on the Camshift.The basic idea is to use two cascade algorithms locating the target as well as speeding up the extraction.Future work will focus on reducing the number of the necessary parameters, and improving the real-time performance.

Figure 2
depicts the current position, centroid, moving direction and velocity.Figures 3-6 depict our approach complete the prediction and tracking of the motion target regardless of the occlusion or not.

Figure 1 .
Figure 1.The flow diagram of our proposed algorithm.