2004年09月07日 15:25:00
采用 CAMSHIFT 算法快速跟蹤和檢測運動目标的 C/C++ 源代碼,OPENCV BETA 4.0 版本在其 SAMPLE 中給出了這個例子。算法的簡單描述如下(英文):
This application demonstrates a fast, simple color tracking algorithm that can be used to track faces, hands . The CAMSHIFT algorithm is a modification of the Meanshift algorithm which is a robust statistical method of finding the mode (top) of a probability distribution. Both CAMSHIFT and Meanshift algorithms exist in the library. While it is a very fast and simple method of tracking, because CAMSHIFT tracks the center and size of the probability distribution of an object, it is only as good as the probability distribution that you produce for the object. Typically the probability distribution is derived from color via a histogram, although it could be produced from correlation, recognition scores or bolstered by frame differencing or motion detection schemes, or joint probabilities of different colors/motions etc.
In this application, we use only the most simplistic approach: A 1-D Hue histogram is sampled from the object in an HSV color space version of the image. To produce the probability image to track, histogram "back projection" (we replace image pixels by their histogram hue value) is used.
算法的詳細情況,請看論文:
<a href="http://www.assuredigit.com/incoming/camshift.pdf">http://www.assuredigit.com/incoming/camshift.pdf</a>