edit: I was looking at the wrong OpenCV2 code example, there is no FeatureDetector::create
in OpenCV3 – this was confusing me.
Hey new to OpenCV and learning by example by pulling apart other peoples C++ code.
I would like to try all available options for:
detector = FeatureDetector::create(str_detector);
descriptor = DescriptorExtractor::create(str_descriptor);
currently str_detector is FAST
and str_descriptor is BRISK
I am having trouble finding what available Detectors and Descriptors are available to me.
Is there a way to output a list of all currently available options?
(I have just built the latest opencv + opencv-contrib from github on a fresh linux install)
I have found a list of 3rd party files here https://github.com/Itseez/opencv_contrib/tree/master/modules/xfeatures2d/src – I think these are 3rd Descriptors and Detectors because those words are mentioned in some of the files. However it would be nice to have a full list of currently compiled/available options to play with.
Thanks!
Trying to find the answer myself, edits as I go:
- Found
typedef Feature2D FeatureDetector
andtypedef Feature2D DescriptorExtractor
inmodules/features2d/include/opencv2/features2d.hpp
- Digging for
Feature2D
now… - I'm so confused, my C++ is failing me, there is no
create
in https://github.com/Itseez/opencv/blob/master/modules/features2d/src/feature2d.cpp - ok so just looking through the code ( https://github.com/Itseez/opencv/blob/master/modules/features2d/include/opencv2/features2d.hpp )
- BRISK
- ORB
- MSER
- FastFeatureDetector / FAST
- AgastFeatureDetector / AGAST
- GFTTDetector
- SimpleBlobDetector
- KAZE / AKAZE
- and from the contrib code ( https://github.com/Itseez/opencv_contrib/blob/master/modules/xfeatures2d/include/opencv2/xfeatures2d.hpp )
- FREAK
- StarDetector
- BriefDescriptorExtractor
- LUCID
- LATCH
- DAISY
- MSDDetector
- and from nonfree contrib code ( https://github.com/Itseez/opencv_contrib/blob/master/modules/xfeatures2d/include/opencv2/xfeatures2d/nonfree.hpp )
- SIFT
- SURF
- Still unsure which of the above can/should be used for FeatureDetector or DescriptorExtractor
Best Answer
You have also the OpenCV documentation to have a list of OpenCV features:
What I do to know if the feature is available only in keypoints detection or descriptor extraction or both is to read the corresponding paper linked in the documentation. It allows also to have a brief description of the features (for example if it is a binary descriptor, main advantages, etc.)
Other solution is to test each feature:
detect()
is ok (no exception thrown) ==> feature detectioncompute()
is ok ==> feature extractiondetectAndCompute()
is ok ==> bothMaybe a more optimal solution exists...
Anyway, from my knowledge (feel free to correct me if I am wrong):
Also with OpenCV 3.1, the code is:
To know which norm type to use:
Finally, why