I am trying to implement a feature/object tracking application using OpenCV and C++. Currently I am using the goodFeaturesToTrack
function to create my feature vector from my first frame. From there, I am passing it to the calcOpticalFlowPyrLk
method to track the points through subsequent frames.
This method is quite fast, but unstable and not scale or rotation invariant. Features have the tendency to drift together as well as get lost and lock onto another corner in the scene. I have been reading a lot about FREAK and it seems like an attractive option. Hopefully it will fix my stability problem as well as being scale and rotation invariant.
While trying to find some help on implementing the FREAK feature extractor, I came across this which got my hopes up, but as you have probably noticed, the file is offline! I was just curious if anyone may have saved the example or have any suggestions as to where I can look for some alternative source code I can study and learn from?
OpenCV has a sample demonstrating FREAK at this link. FREAK is a feature extractor like any other, and exposes the same interface. FREAK does not detect features, so you must use a different method (like cv::goodFeaturesToTrack()
) to detect points of interest.
A summary of that sample is as follows:
cv::Mat image; //This is the image
std::vector<cv::KeyPoint> keypoints; // This comes from your feature detector of choice
cv::Mat descriptors;
cv::FREAK freak;
freak.compute(image, keypoints, descriptors);
// Now "descriptors" contains descriptor data for the input keypoints.