How to initialize a FeatureDetector with OpenCV 3?
With OpenCV 3 I get a SegFault when running the detect()
function of either the ORB or AKAZE detector although the pointer is not null. I assume that something is not initialized. But my compiler is unable to find the previously necessary cv::initModule_features2d();
. What do I need to do to initialize the feature detectors properly?
The code is roughly like the following:
cv::FeatureDetector* detector = cv::ORB::create();
CV_Assert( detector != NULL );
vector<cv::KeyPoint> kpts1;
detector->detect(img, kpts, cv::Mat());
I tried both 8uc3 and 8uc1 images, both ORB and AKAZE and it always segfaulted. Tested on OS X 10.10.
hi, @SR, can you post your code along with the question ?
the features2d api has changed a lot in respect to 2.4 ->3.0, e.g. calling initModule_Something is no more nesssecary