基于OpenCV的運動目標檢測跟蹤實驗平臺
王力超 2010/3/26
(接上頁)據(jù)與從緩存中讀數(shù)據(jù)將不可避免地操作同一塊緩存;為防止數(shù)據(jù)讀寫沖突出錯,兩線程在操作這塊緩存時都必須上鎖。這在本平臺程序中是通過“互斥量”來實現(xiàn)的。另外,為防止main線程重復地分析同一幀圖像,要求main線程必須等待GetImage線程的一個信號才能進行數(shù)據(jù)讀取和分析,這在平臺程序中是通過Wait/Object的方式來實現(xiàn)的。
程序流程圖。
5 實驗結果
經(jīng)過實驗證明,基于OpenCV的運動目標檢測跟蹤實驗平臺可以在實時顯示圖像的基礎上,實時檢測和跟蹤運動目標,并且檢測和跟蹤具有較高的魯棒性。在跟蹤過程中,即時目標保持靜止,程序也不會丟失對目標的跟蹤。檢測跟蹤結果如圖4所示:
上述穩(wěn)定的目標檢測與跟蹤結果,是實現(xiàn)基于全地圖路徑規(guī)劃的機器人算法的前提。實際上圖4也正是一種基于此平臺的視頻智能吸塵器的軟件工作界面。
實踐表明,OpenCV使得在PC機上的數(shù)字圖像處理變得更加簡單便捷、優(yōu)化高效。平臺實時性的要求,使得本實驗對于引導學生學習和掌握OpenCV的性能和使用方法,讓學生熟悉圖像處理,特別是運動目標跟蹤方面的知識,提高PC機Windows操作系統(tǒng)下的C++編程能力,能夠起到相當大的作用。
6 展望
本實驗設計的基于OpenCV的目標檢測、跟蹤平臺,由于其較低的計算復雜度和較高的魯棒性,不僅可用于智能吸塵器的控制;也可用于其它基于全地圖路徑規(guī)劃的機器人領域,比如:收割、搜救、測繪、探傷等等場合。因此本平臺具有廣泛的應用前景。
參考文獻:
[1]Hieu T.Nguyen, Arnold W.M. Smeulders, Fast Occluded Object Tracking by a Robust Appearance Filter, 2004 IEEE.
[2]岡薩雷斯,《數(shù)字圖像處理》[M], 電子工業(yè)出版社, 2005, 40~112.
[3]Gary R. Bradski, Microcomputer Research Lab, Santa Clara, CA, Intel Corporation, Computer Vision Face Tracking For Use in a Perceptual User Interface.
[4]張春田,蘇育挺,《數(shù)字圖像壓縮編碼》[M], 清華大學出版社, 2006, 20~23.
[5]Jeffery Richter, 《Windows核心編程》[M], 2000, 121~287.
[6]錢能. C++ 程序設計教程[M]. 清華大學出版社,1999,4,1~134.
[7]opencv-doc-cn-0.9.7,OpenCV說明文檔.
A Platform for Moving Object Tracking based on OpenCV
WANG Li-chao, CHEN Xi, LU Qi-yong
(E. E. Department, Fudan University, Shanghai 200433, China)
Abstract:As an active research area in these years, moving objects tracking is becoming more and more important in robot vision, monitoring, measurement and compressive coding of videos. A platform for moving objects tracking based on OpenCV is designed, which could perform real time moving objects detecting and tracking. There are also programming and hardware interfaces reserved, which can be used for future research of monitoring, measurement or robot intelligence.
Key words: Object tracking; OpenCV; Experimental platform;Program interface
|