Ask Your Question

Revision history [back]

How to use AKAZE descriptor extractor with KAZE keypoint detector

NOVICE question: http://docs.opencv.org/3.0-beta/modules/features2d/doc/feature_detection_and_description.html states that AKAZE descriptors can only be used with KAZE or AKAZE keypoints. Try to avoid using extract and detect instead of operator() due to performance reasons.

so I tried to use KAZE detector with AKAZE descriptor extractor:

Ptr<feature2d> detector = cv::KAZE::create(); Ptr<descriptorextractor> extractor = cv::AKAZE::create(); ... vector<keypoint> keypoint; Mat features; detector->detect(img, keypoint);

extractor->compute(img, keypoint, features); //<- error at this line

generate the following error: OpenCV Error: Assertion failed (0 <= kpts[i].class_id && kpts[i].class_id < static_cast<int>(evolution_.size())) in cv::AKAZEFeatures::Compute_Descriptors, file ......\src\opencv\modules\features2d\src\kaze\AKAZEFeatures.cpp, line 712

However, when both detector and extractor are the same, there is no problem. Any help is appreciated, thanks. JC

How to use AKAZE descriptor extractor with KAZE keypoint detector

NOVICE question: http://docs.opencv.org/3.0-beta/modules/features2d/doc/feature_detection_and_description.html states that AKAZE descriptors can only be used with KAZE or AKAZE keypoints. Try to avoid using extract and detect instead of operator() due to performance reasons.

so I tried to use KAZE detector with AKAZE descriptor extractor:

Ptr<feature2d>

Ptr<Feature2D> detector = cv::KAZE::create();
Ptr<descriptorextractor> Ptr<DescriptorExtractor> extractor = cv::AKAZE::create();
 ...
vector<keypoint> vector<KeyPoint> keypoint;
Mat features;
detector->detect(img, keypoint);

keypoint); extractor->compute(img, keypoint, features); //<- error at this line

line

generate the following error: error:

OpenCV Error: Assertion failed (0 <= kpts[i].class_id && kpts[i].class_id < static_cast<int>(evolution_.size())) 
in cv::AKAZEFeatures::Compute_Descriptors, file ......\src\opencv\modules\features2d\src\kaze\AKAZEFeatures.cpp, ..\..\..\src\opencv\modules\features2d\src\kaze\AKAZEFeatures.cpp, line 712

712

However, when both detector and extractor are the same, there is no problem. Any help is appreciated, thanks. JC