Reputation: 2079
I read OpenCV SURF manual "ExtractSURF" at http://opencv.willowgarage.com/documentation/python/feature_detection.html
as I understand, this function automatically looks for SURF features on the image.
In many cases, the user wants to feed those features (detected by other algorithms) to this function to get the SURF descriptors for these points. But I think the function (ExtractSURF) doesn't support that. Am I right?? it is fixed with SURF features it find out
Is there any resolution for this??
Thanks
Upvotes: 2
Views: 2553
Reputation: 2079
From the document of OpenCV, both SIFT and SURF feature detection algorithms support this feature:
C++: void SURF::operator()(InputArray img, InputArray mask, vector<KeyPoint>& keypoints, OutputArray descriptors, bool useProvidedKeypoints=false)
C++: void SIFT::operator()(InputArray img, InputArray mask, vector<KeyPoint>& keypoints, OutputArray descriptors, bool useProvidedKeypoints=false)
The parameter is "useProvidedKeypoints" where
Boolean flag. If it is true, the keypoint detector is not run. Instead, the provided vector of keypoints is used and the algorithm just computes their descriptors."
So, in this case, if you have already got some points you feel interested in, you can feed them into the function and it will return the calculated descriptors for those points accordingly (the keypoint detector is not run in this case)
Upvotes: 0
Reputation: 51
According to manual OPENCV document, function "extractSURF" have format as follows:
cv.ExtractSURF(image, mask, storage, params)-> (keypoints, descriptors)
Upvotes: 0
Reputation: 630
You want the example that comes with opencv 2.3 called find_obj.py it is in the opencv\samples\python2 samples directory.
It is an excellent example of using SURF in cv2 and python.
Doc on feature detectors is here: http://opencv.itseez.com/modules/features2d/doc/common_interfaces_of_feature_detectors.html#surffeaturedetector
Upvotes: 1
Reputation: 314
Yes, but not with OpenCV python API. Using SurfDescriptorExtractor in C++.
Upvotes: 0