I am trying to detect and extract image feature using DynamicAdaptedFeatureDetector
, but i am receiving Access violation error. The complete error is: Unhandled exception at 0x000007FEE08AB89A (opencv_features2d2411d.dll) in Feature.exe: 0xC0000005: Access violation reading location 0x0000000000000000.
my sample code is:
.
.
.
Ptr<FeatureDetector> detector;
vector<KeyPoint> keypoints1, keypoints2;
detector = new DynamicAdaptedFeatureDetector(new FastAdjuster(10, true), 5000, 10000, 10);
detector->detect(leftImg_roi, keypoints1);
detector->detect(rightImg_roi, keypoints2);
Ptr<DescriptorExtractor> extractor;
extractor = DescriptorExtractor::create("SIFT");
Mat descriptors1, descriptors2;
extractor->compute(leftImg_roi, keypoints1, descriptors1);
extractor->compute(rightImg_roi, keypoints2, descriptors2);
vector< vector<DMatch> > matches;
Ptr<DescriptorMatcher> matcher = DescriptorMatcher::create("BruteForce");
matcher->knnMatch(descriptors1, descriptors2, matches, 500);
.
.
.
Error is coming in the line: extractor->compute(rightImg_roi, keypoints2, descriptors2);
Total detected keypoints from images are: keypoints1 = 1649 and keypoints2 = 1558
Any idea whats wrong in my code?