0

Hope you are well and safe. I found an implementation of ASIFT in C++ online(http://www.mattsheckells.com/opencv-asift-c-implementation/). But for some reason, i am getting errors during runtime. I have tried and tested the same on 32 bit version with an older opencv(2.4.9), it is running fine however its slow. Now I want to test it on new opencv versions (3x,4x) but till now no success. I am using VS 2019 and compiling opencv using cmake in windows. For Opencv 3.x to access sift libraries, i am using opencv_contrib of the same version and compiling together. But there are no conclusive results. I hope you can guide me on this. I can let you know how i set things up in further edits. The exact step where the debugging fails and error have been posted here.

//cv::xfeatures2d::SiftFeatureDetector detector;
Ptr<cv::xfeatures2d::SiftFeatureDetector> detector = makePtr<cv::xfeatures2d::SiftFeatureDetector>();
//Ptr<cv::xfeatures2d::SiftFeatureDetector> detector = cv::xfeatures2d::SiftFeatureDetector::create();
//detector.detect(timg, kps, mask);
detector->detect(timg, kps, mask);---- the program stops debugging error due to a memory error
"Unhandled exception at 0x00007FFDEC899709 in Project1_asift.exe: Microsoft C++ exception: cv::Exception at memory location 0x000000E5A319DDB8."

and i get this printed on the console:

"OpenCV(3.4.2) Error: The function/feature is not implemented () in cv::Feature2D::detectAndCompute, file c:\build\3_4_winpack-build-win64-vc15\opencv\modules\features2d\src\feature2d.cpp, line 154"

Hope to get a positive response.

enter image description here

Ardent Coder
  • 3,777
  • 9
  • 27
  • 53
  • If you look at the error message in the console, it tells you that SIFT is not enabled. SIFT is patented (until this year) and thus must be explicitely enabled during the OpenCV build. See the `NON_FREE` cmake option. – Catree May 22 '20 at 20:27
  • Yes, i remember enabling the non free option in cmake. It still gave me the same error. However i compiled an old version of opencv with VS and now its working. – Kunal Khosla May 23 '20 at 15:16

0 Answers0