Fast compressive tracking (CT) algorithm analysis, fasttracking
This article is original, reproduced please indicate the source: http://blog.csdn.net/autocyz/article/details/44490009
Fast Compressive Tracking
(Fast Compression tracking)
Although there are many kinds of tracking algorithms, the robustness of many algorithms is poor due to changes in posture, illumination, and obstacles.
Currently, there are two mainstream tracking algorithms: generative tracking algorithms and discriminative algorithms ).
Generate a tracing algorithm. That is to say, learning the sample of this frame uses the learning result as the classifier of the next frame to achieve the learning and tracking effects. The disadvantage of this tracking algorithm is that the first few frames of the video have a small sample size. Therefore, most algorithms require that the target in the video remains unchanged before the video. If the target changes significantly, it may cause drift.
The discriminant algorithm considers tracking as a problem of a binary classifier. Its purpose is to find a boundary that separates the target from the background. However, this algorithm uses only one positive sample and a small number of negative samples to follow the new classifier. When the Feature Template contains noise or location deviation, it will drift.
Algorithm of the author:
The main steps in the author's thesis are as follows:
1. Obtain the features of the target region
In order to obtain the multi-scale feature expression of an image, the input image is often convolutionized with Gaussian filters in Different spaces. In practice, Gaussian filter has a large amount of operation, so rectangular boxes are generally used to replace Gaussian filter. It has been proved that this replacement will not affect the performance of feature detection, and it can greatly speed up detection.
For a sample of W * H, the rectangular box is selected as follows:
W and h represent the width and height of the rectangle respectively.
Convolution of these rectangular boxes and input images is as follows:
The convolution result of each input image (W * H) and a rectangle box of different sizes is still a (W * H) matrix. However, to facilitate the fusion of these features, convert the (W * H) matrix into a column vector containing (W * H) elements. A sample image of an input has a total of (w * h) convolution results. By concatenating the (w * h) column vectors, it becomes) column vector of two elements. The length of this column vector can generally reach 106 ~ 1010. For such high-dimensional features, it will obviously bring about a considerable amount of computing, so the author found a good dimensionality reduction method.
2. Obtain the sparse measurement matrix.
According to the theory of compression sensing, for a compreable signal, such as the original image or video, a small part of the random linear data can retain the significant information in the original signal to the maximum extent, in addition, the original signal can be reproduced from this small random signal. In the theory of compression sensing, there is also a professional ranking to describe the "compress signal"-K-sparse signal mentioned above.
With this theory as the basis, we can first obtain the complex and high-dimensional features of the target, and then use the theory of Compressed Sensing to reduce the feature dimension. The method used by the author is to use the sparse random measurement matrix (R) to reduce the original signal dimension. Obviously, for any K-sparse signal, we all hope that this sparse matrix R can extract significant information from it and map this K-sparse signal from a high dimension to a low dimensional space.
Then, how can we find this sparse matrix R to meet our requirements.
In fact, to find this sparse matrix, you must satisfy a property, that is, "constraint equality ".
A typical random sparse matrix that satisfies the constraint equi-distance is a Gaussian random matrix.
It has been proved that when p = 1 and 3, This matrix satisfies the constraint equi. Note that when P = 3, 2/3 of the data is 0, so no computation is required.
Multiply the m * n sparse matrix by the original high-dimensional vector (m dimension) to obtain a low-dimensional vector (n-dimensional ). This is the result of dimensionality reduction.
3. Use a sparse measurement matrix to reduce the dimension of features
We can see that the process of dimensionality reduction of high-dimensional vectors using the random sparse matrix. In the sparse matrix, black is positive, gray is negative, and white is 0. It can be seen that this sparse matrix is very sparse and has few non-zero items, which can significantly reduce the data processing capacity. In vector v after dimensionality reduction, each element is the sum of non-zero items corresponding to R in vector x, which contains the sum of multiple local information.
4. Classification Using Bayesian Classifier
V is the feature vector. p (y = 1) and p (y = 0) represent the prior probability of positive and negative samples respectively. In fact, p (y = 1) = p (y = 0 ). It is proved that the random ing of high-dimensional random vectors always satisfies the load Gaussian distribution. Therefore, p (vi | y = 1) and p (vi | y = 0) conform to Gaussian distribution. The parameter is (λ> 0, which is a learning parameter ):
This is the integral graph distribution obtained by three different low-dimensional spatial features.
This is an integral graph distribution chart that measures the quality of positive and negative samples.
Steps in the program:
I. First frame image:
1. Manually mark the area to be tracked. This area is a rectangle frame.
2. Rectangle frames are randomly generated based on the information of the marked area and used as a Haar Feature Extraction template.
3. Taking the target area of the current frame as the center and taking the radius of 4 pixels as the radius, a total of 45 positive samples are taken, with 8 as the inner radius, 50 negative samples are randomly selected from the ring with 30 outer radius.
4. Calculate the integral graph of the original image.
5. Based on the integral graph and the preceding Haar Feature Extraction template, the features of positive and negative samples are extracted.
6. Update the Bayesian classifier to obtain the new classifier.
2. Non-first frame image:
1. If the target area of the previous frame is centered and the radius of 25 pixels is traversed one by one, about 1100 areas to be classified can be obtained.
2. Obtain the integral graph of the areas to be classified and use the preceding Haar-like Feature Template to extract the Haar features of these areas. Obtain the feature vector.
3. Use Bayesian classifier to classify the areas to be classified, and select the rectangle most likely to be the target as the current tracking result.
4. Repeat steps 3, 4, 5, and 6 in step 1.