Multi-Track 演算法#

Multi-track 是一套用於 CMUcam3 的簡單多物體追蹤演算法,由 Steve Sherman 為馬里蘭大學帕克分校 Collective Dynamics and Control Lab 的 Derek Paley 博士所開發。此演算法的核心是在影像畫格的小區域上呼叫簡單的色彩追蹤,然後將回傳的邊界框合併在一起,以提供一份找到的物體清單。

在典型的三通道全解析度影像上,multitrack 執行大約需要 450 毫秒。相較之下,simple_color_track 為 300 毫秒,而基本的亮像素搜尋為 200 毫秒。在全解析度單通道影像上,multitrack 約需 340 毫秒,簡單色彩追蹤約 200 毫秒,亮像素則約 150 毫秒。我確信還有許多可以進行的最佳化,因此歡迎自由地修改與改進此演算法。

multitrack 的呼叫範例:

multitrack_pkt_t tracker;
cc3_pixbuf_load();  //takes picture
multitrack(&tracker);

//make sure to free the memory after you are done to prevent a memory leak
free(tracker.objects);

tracker.entries=0;

每個 multitrack_pkt_t 的定義如下:

typedef struct {

  uint8_t entries; // the number of objects

  cc3_track_pkt_t* objects;//pointer to the array of objects
  cc3_track_pkt_t base; //the reference color data

  uint8_t divh; //number of rows of blocks

  uint8_t divw; //number of columns of blocks

  uint16_t tolerance; //max distance track_pkts must be to merge

  uint8_t minpix; // minimum number of pixels to not be filtered

  uint8_t mindensity; //minimum density to not be filtered

  uint8_t minwidth; //minimum dimension of a track pkt

} multitrack_pkt_t;

更多說明文件應可在原始碼中找到,還有一個範例 main 檔案,但如果您有任何問題,歡迎在論壇中提問。