• 沒有找到結果。

第四章 移動物體之自動追蹤系統

4.4 平均位移法的實作流程

之前章節已介紹平均位移法的基礎知識及應用原理,在此節將介紹在二維的視訊影 像中,以平均位移法實現追蹤的系統流程。

以上定義了樣版影像與候選影像的色彩分佈密度函數,以 Bhattacharyya 係數計算兩 者間的相似度,再利用平均位移疊代法求得最高的 Bhattacharyya 係數。在平均位移疊代 法中,候選影像的起始位置的選擇是很重要,若選擇錯誤會令追蹤的結果完全失敗,然

置 , 根 據

Bhattacharyya 係 數

=

Bhattacharyya 係數。

4. 由

證 Bhattacharyya 係數是否增加,若 Bhattacharyya 係數沒有增加,則修正新位置y1

經由以上步驟的疊代,我們可以藉著計算出相似度最高的候選影像,達到追蹤的效 果。

第五章 實驗結果

此系統的實驗影片是經由手持式攝影機,拍攝在戶外的環境中目標物體移動的影 像,並透過影像擷取卡將影像轉換成為 320*240 像素大小的影像序列,所擷取的影像資 料格式為 24 位元彩色的未壓縮 AVI 影像檔,將此 AVI 影像檔輸入至本論文的實驗系統,

產生輸出影像。此系統的測試硬體設備為 Pentium 4 2.8GHz 中央處理器,512MB 的記憶 體,作業環境是 Microsoft Windows XP,此實驗的開發平台為 Borland C++ 6.0,圖 5.1 為實驗的輸出畫面。

圖 5.1:系統程式輸出畫面

在左上角的部分為前一張視訊影像,紅色方框為移動物體偵測的結果,右上角為下 一張視訊影像,同時也顯示出每個區塊的區域移動向量,而在左下角為經由全域區域移 動向量補償後所得到的連續影像相減的結果,右下角為左下角的影像經過移動統計後所 求得的移動區塊。

在我們在實驗中,偵測到移動物體後,即以紅色方框來表示,進入追蹤部分,即以 藍色方框來表示。

frame 75 frame 76

圖 5.2:系統程式輸出結果

當與樣版影像相似度太低時,令其進入移動物體偵測程序。

frame 113 frame 114

圖 5.3:與樣版影像相似度太低時的結果

追蹤系統可以容忍部分遮蔽物的阻礙:雖然有黃色的旗子干擾,在干擾部分不大 時,仍能執行追蹤功能。

frame 210 frame 212

frame 214 frame 216

frame 219 frame 221

frame 227 frame 229

圖 5.4:部分遮蔽物時的結果

樣版影像中背景部分的影像變動,可使系統重新偵測移動物體,以更新移動物體的 資訊。實際執行三個影片,統計移動物體偵測與追蹤的執行時間與執行次數,完成下表:

影片 1 影片 3 影片 2

總圖幅 1179 2391 2070

整體效能 fps 27.681 24.277 20.135 MD 總秒數 19.857 52.752 70.805

MD 圖幅 112 298 404

MD fps 5.640 5.649 5.706

TR 總秒數 22.735 45.738 32.002

TR 圖幅 1067 2093 1666

TR fps 46.932 45.761 52.059 MD: Motion Detection TR: Tracking

表 5.1:移動物體偵測與追蹤的執行時間

在表 5.1 中我們先統計影片的總圖幅數與計算其整體效能,在此效能的計算單位為 fps(frames per second),我們可以得到第一行及第二行的數據,再來針對影片中的移動物 體偵測部分(MD)和追蹤部分(TR)分別統計其處理所耗費的時間與圖幅數,即 MD(/TR) 總秒數和 MD(/TR)圖幅,計算其處理效能,得到 MD fps 與 TR fps 的數據。

由表 5.1 中可得移動物體偵測處理的速度為 5.6~5.7fps,平均位移追蹤處理的速度為 45~52fps,我們可以得知整體系統主要的載荷是在移動物體偵測系統的部分,因此若使 整體系統的效能提升,移動物體偵測系統的執行速度會是個瓶頸,因為它必須得到整個 影像的移動資訊,勢必經過很多的計算,因此在系統中,我們針對移動物體偵測系統的 執行速度不夠快,利用將影像分為區塊來估計移動資訊,以增加執行速度,實驗結果顯 示每秒處理 5.6~5.7 張影像,但尚未達到即時性的應用,為了能適應即時性的應用,我 們在其後使用平均位移追蹤系統,實驗結果顯示每秒可處理 45~52 張影像,執行的速度 相當快速,使整體系統可提升至每秒處理 20~27 張影像,藉由 Bhattacharyya Coefficient 判斷追蹤物體是否相似,來偵測追蹤錯誤,若追蹤錯誤,即回到移動物體偵測系統:

frame 414 frame 415

frame 418 frame 423

frame 426 frame 430

frame 433 frame 435

frame 436 frame 437

圖 5.5:連續影像實驗輸出結果

第六章

結論與未來工作

在此論文提出了一個系統對室外場景之下動態背景中的移動物體偵測及追蹤,在此 系統中分為兩個子系統:移動物體偵測系統及追蹤系統。在移動物體偵測系統中,使用 基本的影像前處理來消除雜訊與壓縮資料量,以連續影像相減法在執行速度上的優勢對 連續的兩張影像做相減的程序,從而得到影像移動的部分,再將影像以區塊為基礎,計 算其移動量得到可能移動的區塊,再將移動量大的區塊群集起來,其結果即為移動物體 的區域;而在追蹤系統中,以移動物體偵測系統所得到的移動物體的區域為樣版,因中 間畫素的資訊重要度較邊緣高,乘上核心函數賦予不同的權重,在之後的影像中,以平 均位移演算法反覆疊代出相似度最高的平均位移向量,此結果便為物體移動後的位置,

以達到追蹤的效果。

在整體系統的運作部分,移動物體偵測系統因其運算量大,執行速度較慢,是整個 系統的瓶頸之處,而追蹤系統的平均位移演算法計算量少執行速度快,在此運用兩者各 有的優勢組成整體系統;在偵測到移動物體後,即將移動物體的區域交由追蹤系統,藉 由執行效率快速的平均位移演算法達成追蹤的效果,以 Bhattacharyya coefficient 來判斷 是否追蹤錯誤,在 Bhattacharyya coefficient 過低,即相似度不高的情形下,將控制權交 還給移動物體偵測系統,再度偵測移動物體的區域,交由追蹤系統追蹤之,如此反覆此 運作模式,以提升整體系統的效能,適用於即時性的應用。

在此系統中仍存在些缺點,在有樹葉或草地的背景之下,易受到樹葉的雜訊而造成 移動物體偵測的誤判,此項缺點可藉由前處理雜訊的抑制,使其影響下降,但若移動物 體與樹葉太接近時,雜訊抑制的效果便會降低而造成誤判;在多個移動物體時,只能偵 測到移動量較大的,若兩個移動物體太接近時,會被認為是同一個物體而造成誤判,這

是未來需要克服及改進的地方。移動物體偵測系統需要對整個畫面做運算,一直是偵測 時的困難點,若能在此提高運算效能,可使整體系統效能提升,也可以再處理更大的影 像畫面。

參考文獻

[1] B. K. P. Horn and B. G. Schunck, "Determining optical flow," Artificial Intelligence, vol.

17, pp. 185-203, 1981.

[2] J. Barron, D. Fleet, and S. Beauchemin, “Performance of Optical Flow Techniques,”

International Journal of Computer Vision, vol.12, no.1, pp.42–77, Jan. 1994.

[3] A. M. Tekalp, “Digital video processing,” Prentice Hall PTR, 1995.

[4] A. J. Lipton, H. Fujiyoshi, and R. S. Patil, “Moving target classification and tracking from real-time video,” in Proc. of the IEEE Workshop on Applications of Computer Vision, pp. 8–14, Oct. 1998.

[5] C. Kim and J. N. Hwang, “A fast and robust moving object segmentation in video sequences,” in Proc. of the IEEE International Conference on Image Processing (ICIP’99), vol.2, Kobe, Japan, pp. 131–134, Oct. 1999.

[6] C. Kim and J. N. Hwang, “Fast and automatic video object segmentation and tracking for content-based applications, ” IEEE Transactions Circuits and Systems for Video Technology, vol. 12, pp. 122-129, Feb. 2002.

[7] A. H. S. Lai and N. H. C. Yung, “A fast and accurate scoreboard algorithm for estimating stationary backgrounds in an image sequence,” in Proc. of the IEEE International Symposium on Circuits and Systems, vol. 4, pp. 241-244, 1998.

[8] A.G. Nguyen and J. N. Hwang, “Scene context dependent key frame selection in streaming,” in Proc. of the 22nd International Conference on Distributed Computing Systems Workshops, pp.208–213, Jul. 2002.

[9] S. Gupte, O. Masoud, R. F. K. Martin, and N. P. Papanikolopoulos, “Detection and classification of vehicles,” IEEE Transactions on Intelligent Transportation Systems, vol.

3, no. 1, pp. 37-47, Mar. 2002.

[10] M. Kass, A. Witkin, and D. Terzopoulos, “Snakes: active contour models,” International Journal of Computer Vision, vol. 1, pp. 321–332, 1988.

[11] N. Peterfreund, “Robust Tracking of Position and Velocity With Kalman Snakes”, IEEE Transactions on Pattern Analysis and Machine Intelligence, vol. 21, no. 6, pp. 564-569, Jun. 1999.

[12] D. Koller, J. Weber, T. Huang, J. Malik, G. Ogasawara, B. Rao, and S. Russell, “Towards robust automatic traffic scene analysis in real-time,” in Proc. of the 12th IAPR International Conference on Pattern Recognition, vol. 1, pp. 126-131, 1994.

[13] A. Chachich, A. Pau, A. Barber, K. Kennedy, E. Olejniczak, J. Hackney, Q. Sun, and E.

Mireles, “Traffic sensor using a color vision method,” in Proc. of SPIE: Transportation Sensors and Controls: Collision Avoidance, Traffic Management, and ITS, vol. 2902, pp.

156–165, 1996.

[14] K. Schwerdt and J. L. Crowley, “Robust face tracking using color,” in Proc. of the 4th IEEE International Conference on Automatic Face and Gesture Recognition, pp. 90-95, Mar. 2000.

[15] I. A. Karaulova, P. M. Hall, and A. D. Marshall, “A hierarchical model of dynamics for tracking people with a single video camera,” in Proc. of British Machine Vision Conference, pp. 262–352, 2000.

[16] C. J. Li, and S. J. Wang, “Detection and Tracking of a Single Deformable Object on an Active Surveillance Camera,” in Proc. Computer Vision, Graphics, and Image Processing, Kinmen , Taiwan , Aug. 2003.

[17] R. C. Gonzalez, and R. E. Woods, “Digital Image Processing,” Prentice Hall, 2002.

[18] M. Sonka, V. Hlavac, and R. Boyle, “Image Processing, Analysis, and Machine Vision,”

PWS Publishing, 1999.

[19] I. Pitas, “Digital Image Processing Algorithms and Applications,” John Wiley & Sons, 2000.

[20] J.R. Parker, “Algorithms for Image Processing and Computer Vision,” John Wiley &

Sons, 1997

[21] R. Szeliski, "Video Mosaics for Virtual Environments," IEEE Computer Graphics and Applications, vol. 16, no. 2, pp. 22-30, Mar. 1996.

[22] J. W. Hsieh, “Moving Object Detection and Mosaic Construction by Image Stitching,”

2003 National Computer Symposium, pp.183-190, Dec. 18-19, 2003.

[23] A. M. Tekalp, “Digital video processing,” Prentice Hall PTR, 1995.

[24] L. G. Shapiro, and G. C. stockman, “Computer vision,” Prentice Hall Inc., 2001.

[25] J.R. Jain, and A.K. Jain, "Displacement measurement and its application in interframe image coding", IEEE Transactions on Communications, vol. 29, no. 12, pp. 1799-1808, Dec. 1981.

[26] J. R. Corbera and D.L. Neuhoff, "On the optimal block size for block-based, motion compensated video coders," SPIE Proceedings of Visual Communications and Image Processing, vol. 3024, pp 1132-1143, Feb. 1997.

[27] D. W. Scott, “Multivariate Density Estimation,” John Wiley & Sons, Inc., 1992.

[28] D. Comaniciu, and P. Meer, “Mean Shift Analysis and Applications,” IEEE Intelligence Conference Computer Vision (ICCV'99), Kerkyra, Greece, pp. 1197-1203, 1999.

[29] D. Comaniciu, and P. Meer, “Mean Shift: A Robust Approach toward Feature Space Analysis,” IEEE Transactions Pattern Analysis Machine Intelligence, vol. 24, no. 5, pp.

603-619, 2002.

[30] D. Comaniciu, and V. Ramesh, “Mean Shift and Optimal Prediction for Efficient Object Tracking, ” IEEE Intelligence Conference Image Processing (ICIP'00), Vancouver, Canada, vol. 3, pp. 70-73, 2000.

[31] D. Comaniciu, and V. Ramesh, “Robust Detection and Tracking of Human Faces with an Active Camera,” IEEE Transactions Pattern Analysis Machine Intelligence, vol. 24, no.

5, pp. 603-619, 2002.

[32] D. Comaniciu, V. Ramesh, and P. Meer, “Kernel-Based Object Tracking, ” IEEE Transactions Pattern Analysis Machine Intelligence, vol. 25, no. 5, pp. 564-575, 2003.

[33] T. Kailath, “The Divergence and Bhattacharyya Distance Measures in Signal Selection,”

IEEE Transactions Communications Technology, vol. 15, pp. 52-60, 1967.

[34] K. Fukunaga, and L.D. Hostetler, “The estimation of the gradient of a density function, with applications in pattern recognition,” IEEE Trans. Information Theory, vol. 21, pp.

32-40, 1975.

[35] Y. Cheng, “Mean Shift, Mode Seeking, and Clustering,” IEEE Transactions on Pattern Analysis and Machine Intelligence, vol. 17, no. 8, pp. 790-799, Aug., 1995.

[36] 張龍生, “動態場景中的人物之偵測與追蹤,” 大同大學電機工程研究所碩士論文, 2004.

相關文件