<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE article  PUBLIC "-//NLM//DTD Journal Publishing DTD v3.0 20080202//EN" "http://dtd.nlm.nih.gov/publishing/3.0/journalpublishing3.dtd"><article xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" dtd-version="3.0" xml:lang="en" article-type="research article"><front><journal-meta><journal-id journal-id-type="publisher-id">AJCM</journal-id><journal-title-group><journal-title>American Journal of Computational Mathematics</journal-title></journal-title-group><issn pub-type="epub">2161-1203</issn><publisher><publisher-name>Scientific Research Publishing</publisher-name></publisher></journal-meta><article-meta><article-id pub-id-type="doi">10.4236/ajcm.2016.64035</article-id><article-id pub-id-type="publisher-id">AJCM-73149</article-id><article-categories><subj-group subj-group-type="heading"><subject>Articles</subject></subj-group><subj-group subj-group-type="Discipline-v2"><subject>Physics&amp;Mathematics</subject></subj-group></article-categories><title-group><article-title>
 
 
  Improved Video Moving Target Tracking Based on Camshift
 
</article-title></title-group><contrib-group><contrib contrib-type="author" xlink:type="simple"><name name-style="western"><surname>Liang</surname><given-names>Li</given-names></name><xref ref-type="aff" rid="aff1"><sup>1</sup></xref></contrib><contrib contrib-type="author" xlink:type="simple"><name name-style="western"><surname>Yi</surname><given-names>Luo</given-names></name><xref ref-type="aff" rid="aff1"><sup>1</sup></xref></contrib></contrib-group><aff id="aff1"><addr-line>The College of Automation and Electronic Information, Sichuan University of Science &amp;amp; Engineering, Zigong, China</addr-line></aff><pub-date pub-type="epub"><day>11</day><month>11</month><year>2016</year></pub-date><volume>06</volume><issue>04</issue><fpage>357</fpage><lpage>364</lpage><history><date date-type="received"><day>November</day>	<month>29,</month>	<year>2016</year></date><date date-type="rev-recd"><day>Accepted:</day>	<month>December</month>	<year>26,</year>	</date><date date-type="accepted"><day>December</day>	<month>29,</month>	<year>2016</year></date></history><permissions><copyright-statement>&#169; Copyright  2014 by authors and Scientific Research Publishing Inc. </copyright-statement><copyright-year>2014</copyright-year><license><license-p>This work is licensed under the Creative Commons Attribution International License (CC BY). http://creativecommons.org/licenses/by/4.0/</license-p></license></permissions><abstract><p>
 
 
  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.
 
</p></abstract><kwd-group><kwd>Camshift</kwd><kwd> Target Tracking</kwd><kwd> Gaussian Mixture Model</kwd><kwd> Kalman Prediction</kwd><kwd> Object Shelter</kwd></kwd-group></article-meta></front><body><sec id="s1"><title>1. Introduction</title><p>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 [<xref ref-type="bibr" rid="scirp.73149-ref1">1</xref>] 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 [<xref ref-type="bibr" rid="scirp.73149-ref2">2</xref>] or similar to the environment background in the same hue. Due to the requirement of the initialization manually for Camshift tracking, Wu D [<xref ref-type="bibr" rid="scirp.73149-ref3">3</xref>] proposed the use of inter- frame 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 [<xref ref-type="bibr" rid="scirp.73149-ref4">4</xref>] 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 [<xref ref-type="bibr" rid="scirp.73149-ref5">5</xref>] [<xref ref-type="bibr" rid="scirp.73149-ref6">6</xref>] to estimate the target position which improves the accuracy of the tracking results. Xia J [<xref ref-type="bibr" rid="scirp.73149-ref7">7</xref>] proposed the combination of two-frame-diffe- rence 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 [<xref ref-type="bibr" rid="scirp.73149-ref8">8</xref>] proposed the difference method to obtain the target without considering the similarities among the elements easily confused.</p><p>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.</p></sec><sec id="s2"><title>2. Camshift Algorithm</title><p>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 [<xref ref-type="bibr" rid="scirp.73149-ref9">9</xref>] [<xref ref-type="bibr" rid="scirp.73149-ref10">10</xref>] .</p><p>The implementation steps of the Camshift algorithm are as follow:</p><p>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.</p><p>2) According to the probability distribution, the zero and first order moments of the image in the tracking window are calculated:</p><disp-formula id="scirp.73149-formula553"><label>(1)</label><graphic position="anchor" xlink:href="http://html.scirp.org/file/6-1100568x2.png"  xlink:type="simple"/></disp-formula><disp-formula id="scirp.73149-formula554"><label>(2)</label><graphic position="anchor" xlink:href="http://html.scirp.org/file/6-1100568x3.png"  xlink:type="simple"/></disp-formula><disp-formula id="scirp.73149-formula555"><label>(3)</label><graphic position="anchor" xlink:href="http://html.scirp.org/file/6-1100568x4.png"  xlink:type="simple"/></disp-formula><p>And then take the Equation (1), (2) and (3) into Equation (4) separately.</p><p><img src="http://html.scirp.org/file/6-1100568x5.png" />,<img src="http://html.scirp.org/file/6-1100568x6.png" /> (4)</p><p>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.</p><p>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.</p></sec><sec id="s3"><title>3. Update of the Camshift Algorithm</title><sec id="s3_1"><title>3.1. Foreground Extraction Based on GMM</title><p>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.</p><disp-formula id="scirp.73149-formula556"><label>(5)</label><graphic position="anchor" xlink:href="http://html.scirp.org/file/6-1100568x7.png"  xlink:type="simple"/></disp-formula><disp-formula id="scirp.73149-formula557"><label>(6)</label><graphic position="anchor" xlink:href="http://html.scirp.org/file/6-1100568x8.png"  xlink:type="simple"/></disp-formula><p>where <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/6-1100568x9.png" xlink:type="simple"/></inline-formula> is gauss distribution density function. <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/6-1100568x10.png" xlink:type="simple"/></inline-formula>is the mean and <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/6-1100568x11.png" xlink:type="simple"/></inline-formula> is the covariance of the t<sup>th</sup> component.</p><p>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 [<xref ref-type="bibr" rid="scirp.73149-ref11">11</xref>] [<xref ref-type="bibr" rid="scirp.73149-ref12">12</xref>] .</p><disp-formula id="scirp.73149-formula558"><label>(7)</label><graphic position="anchor" xlink:href="http://html.scirp.org/file/6-1100568x12.png"  xlink:type="simple"/></disp-formula><p>Here, <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/6-1100568x13.png" xlink:type="simple"/></inline-formula>is the learning rate.<inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/6-1100568x14.png" xlink:type="simple"/></inline-formula>, <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/6-1100568x15.png" xlink:type="simple"/></inline-formula>, <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/6-1100568x16.png" xlink:type="simple"/></inline-formula></p><disp-formula id="scirp.73149-formula559"><label>(8)</label><graphic position="anchor" xlink:href="http://html.scirp.org/file/6-1100568x17.png"  xlink:type="simple"/></disp-formula><disp-formula id="scirp.73149-formula560"><label>(9)</label><graphic position="anchor" xlink:href="http://html.scirp.org/file/6-1100568x18.png"  xlink:type="simple"/></disp-formula><disp-formula id="scirp.73149-formula561"><label>(10)</label><graphic position="anchor" xlink:href="http://html.scirp.org/file/6-1100568x19.png"  xlink:type="simple"/></disp-formula></sec><sec id="s3_2"><title>3.2. Kalman Prediction</title><p>The moving target can be described by the current position and velocity in the time domain [<xref ref-type="bibr" rid="scirp.73149-ref13">13</xref>] [<xref ref-type="bibr" rid="scirp.73149-ref14">14</xref>] . 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.</p><p>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:</p><disp-formula id="scirp.73149-formula562"><label>(11)</label><graphic position="anchor" xlink:href="http://html.scirp.org/file/6-1100568x20.png"  xlink:type="simple"/></disp-formula><disp-formula id="scirp.73149-formula563"><label>(12)</label><graphic position="anchor" xlink:href="http://html.scirp.org/file/6-1100568x21.png"  xlink:type="simple"/></disp-formula><p>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.</p><disp-formula id="scirp.73149-formula564"><label>(13)</label><graphic position="anchor" xlink:href="http://html.scirp.org/file/6-1100568x22.png"  xlink:type="simple"/></disp-formula><disp-formula id="scirp.73149-formula565"><label>(14)</label><graphic position="anchor" xlink:href="http://html.scirp.org/file/6-1100568x23.png"  xlink:type="simple"/></disp-formula><disp-formula id="scirp.73149-formula566"><label>(15)</label><graphic position="anchor" xlink:href="http://html.scirp.org/file/6-1100568x24.png"  xlink:type="simple"/></disp-formula><disp-formula id="scirp.73149-formula567"><label>(16)</label><graphic position="anchor" xlink:href="http://html.scirp.org/file/6-1100568x25.png"  xlink:type="simple"/></disp-formula><p>where P<sub>1</sub>(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 <xref ref-type="fig" rid="fig1">Figure 1</xref>.</p></sec></sec><sec id="s4"><title>4. Experiment</title><p>We evaluate our approach on the 640 &#215; 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.</p><p>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 <xref ref-type="fig" rid="fig2">Figure 2</xref>, the original Camshift tracking detect the object, but it had some area undetected. Our proposed algorithm can detect the whole object by foreground extraction algorithm by improved GMM. After the detecting the tracking target, original Camshift algorithm lost the tracking of the target because of the shelter in <xref ref-type="fig" rid="fig4">Figure 4</xref>. Ours can still predict the target’s position by Kalman prediction. Finally, both original Camshift algorithm and ours can detect the tracking target in <xref ref-type="fig" rid="fig6">Figure 6</xref>. Nevertheless, ours has more stable and accurate tracking performance than original Camshift algorithm even without the occlusion.</p><p><xref ref-type="fig" rid="fig2">Figure 2</xref> 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.</p><fig id="fig1"  position="float"><label><xref ref-type="fig" rid="fig1">Figure 1</xref></label><caption><title> The flow diagram of our proposed algorithm</title></caption><graphic mimetype="image"   position="float"  xlink:type="simple"  xlink:href="http://html.scirp.org/file/6-1100568x26.png"/></fig><fig id="fig2"  position="float"><label><xref ref-type="fig" rid="fig2">Figure 2</xref></label><caption><title> The 85<sup>th</sup> frame tracking result</title></caption><graphic mimetype="image"   position="float"  xlink:type="simple"  xlink:href="http://html.scirp.org/file/6-1100568x27.png"/></fig><fig id="fig3"  position="float"><label><xref ref-type="fig" rid="fig3">Figure 3</xref></label><caption><title> The 110<sup>th</sup> frame tracking result</title></caption><graphic mimetype="image"   position="float"  xlink:type="simple"  xlink:href="http://html.scirp.org/file/6-1100568x28.png"/></fig><fig id="fig4"  position="float"><label><xref ref-type="fig" rid="fig4">Figure 4</xref></label><caption><title> The 123<sup>th</sup> frame tracking result</title></caption><graphic mimetype="image"   position="float"  xlink:type="simple"  xlink:href="http://html.scirp.org/file/6-1100568x29.png"/></fig><fig id="fig5"  position="float"><label><xref ref-type="fig" rid="fig5">Figure 5</xref></label><caption><title> The 157<sup>th</sup> frame tracking result</title></caption><graphic mimetype="image"   position="float"  xlink:type="simple"  xlink:href="http://html.scirp.org/file/6-1100568x30.png"/></fig><fig id="fig6"  position="float"><label><xref ref-type="fig" rid="fig6">Figure 6</xref></label><caption><title> The 185<sup>th</sup> frame tracking result</title></caption><graphic mimetype="image"   position="float"  xlink:type="simple"  xlink:href="http://html.scirp.org/file/6-1100568x31.png"/></fig></sec><sec id="s5"><title>5. Outlook and Conclusion</title><p>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.</p></sec><sec id="s6"><title>Cite this paper</title><p>Li, L. and Luo, Y. (2016) Improved Video Moving Target Tracking Based on Camshift. American Journal of Computational Mathematics, 6, 357-364. http://dx.doi.org/10.4236/ajcm.2016.64035</p></sec></body><back><ref-list><title>References</title><ref id="scirp.73149-ref1"><label>1</label><mixed-citation publication-type="book" xlink:type="simple">Tang, Q., Dai, S.G. and Yang, J. (2013) Object Tracking Algorithm Based on Camshift Combining Background Subtraction with Three Frame Difference. In: Kim, Y.-H., Ed., Applied Mechanics and Materials, Trans Tech Publications Inc., Switzerland, 1116-1119. https://doi.org/10.4028/www.scientific.net/amm.373-375.1116</mixed-citation></ref><ref id="scirp.73149-ref2"><label>2</label><mixed-citation publication-type="other" xlink:type="simple">Chen, J., Zhu, C. and Luo, B. (2015) A Combination of Camshift Algorithm and Brisk Feature Point for Real Time Moving Target Tracking. Journal of Chongqing University of Technology (Natural Science), 29, 112-119.</mixed-citation></ref><ref id="scirp.73149-ref3"><label>3</label><mixed-citation publication-type="other" xlink:type="simple">Wang, X., Yang, G. and Wu, S. (2016) An Improved Algorithm for Target Tracking Based on Camshift Algorithm and Kalman Filter. Industrial Control Computer, 29, 80-81.</mixed-citation></ref><ref id="scirp.73149-ref4"><label>4</label><mixed-citation publication-type="book" xlink:type="simple">KaewTraKulPong, P. and Bowden, R. (2002) An Improved Adaptive Background Mixture Model for Real-Time Tracking with Shadow Detection. In: Remagnino, P. and Jones, G.A., Eds., Computer Vision and Distributed Processing, Springer, New York, 135-144. https://doi.org/10.1007/978-1-4615-0913-4_11</mixed-citation></ref><ref id="scirp.73149-ref5"><label>5</label><mixed-citation publication-type="other" xlink:type="simple">Hofmann, M., Tiefenbacher, P. and Rigoll, G. (2012) Background segmentation with feedback: The Pixel-Based Adaptive Segmenter. Proceedings of 2012 IEEE Computer Society Conference on Computer Vision and Pattern Recognition Workshops, Rhode Island, 16-21 June 2012, 38-43.</mixed-citation></ref><ref id="scirp.73149-ref6"><label>6</label><mixed-citation publication-type="other" xlink:type="simple">Zuo, J., Liang, Y., Pan, Q., Zhao, C. and Zhang, H. (2008) Camshift Tracker Based on Multiple Color Distribution Models. Acta Automatica Sinica, 34, 736-742. https://doi.org/10.3724/SP.J.1004.2008.00736</mixed-citation></ref><ref id="scirp.73149-ref7"><label>7</label><mixed-citation publication-type="other" xlink:type="simple">Yan, J., Chen, S. and Ai, S. (2014) Target Tracking with Improved CAMShift Based on Kalman Predictor. Journal of Chinese Inertial Technology, 22, 536-542.</mixed-citation></ref><ref id="scirp.73149-ref8"><label>8</label><mixed-citation publication-type="other" xlink:type="simple">Xia, J., Wu, J., Zhai, H. and Cui, Z. (2009) Moving Vehicle Tracking Based on Double Difference and Camshift. Proceedings of the 2009 International Symposium on Information Processing, Huangshan, 21-23 August 2009, 29-32.</mixed-citation></ref><ref id="scirp.73149-ref9"><label>9</label><mixed-citation publication-type="other" xlink:type="simple">Liu, S. and Jiang, X. (2010) A Moving Object Tracking Algorithm Based on Modified Camshift/Kalman Filter. Control Engineering of China, 17, 470-474.</mixed-citation></ref><ref id="scirp.73149-ref10"><label>10</label><mixed-citation publication-type="other" xlink:type="simple">Karavasilis, V., Nikou, C. and Likas, A. (2011) Visual Tracking Using the Earth Mover’s Distance between Gaussian Mixtures and Kalman Filtering. Image and Vision Computing, 29, 395-305. https://doi.org/10.1016/j.imavis.2010.12.002</mixed-citation></ref><ref id="scirp.73149-ref11"><label>11</label><mixed-citation publication-type="other" xlink:type="simple">Xiu, C. and Wei, S. (2015) Camshift Tracking with Saliency Histogram. Optics and Precision Engineering, 23, 1749-1757. https://doi.org/10.3788/OPE.20152306.1749</mixed-citation></ref><ref id="scirp.73149-ref12"><label>12</label><mixed-citation publication-type="other" xlink:type="simple">Wu, D., Cheng, W. and Yu, S. (2010) Camshift Object Tracking Algorithm Based on Inter-frame Difference and Motion Prediction. Opto-Electronic Engineering, 37, 55-60.</mixed-citation></ref><ref id="scirp.73149-ref13"><label>13</label><mixed-citation publication-type="other" xlink:type="simple">Wang, Y., Cheng, H., Li, S. and Gao, C. (2016) Multi-Strategy Scale Adaptive Tracking Algorithm via Keypoint Matching. Computer Engineering and Design, 37, 247-253.</mixed-citation></ref><ref id="scirp.73149-ref14"><label>14</label><mixed-citation publication-type="other" xlink:type="simple">Liu, H., Long, Y. and Zhang, C. (2015) A Mean-Shift Tracking Algorithm Based on Background Weighted Histogram. Journal of Hunan University of Technology, 29, 69-73.</mixed-citation></ref></ref-list></back></article>