Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Use OpenCL feature detector.

How to use OpenCL based feature detector? According to the source code (here) There is opencl version AKAZE,FAST and ORB. I want to know how to use them in C++ ?

I tried importing #include <opencv2/core/ocl.hpp> and then I also set cv::ocl::setUseOpenCL(true); and for sanity check I did v::ocl::haveOpenCL(). Doing these I can confirm I've built OpenCV with OpenCL support.

That being said I tried converting all cv::Mat to cv::UMat. Now the program crashes at detector->detectAndCompute(umat, cv::noArray(), kp1, des1);. I'm using AKAZE.

The error on the console is:

OpenCV(4.0.0-dev) Error: Requested object was not found (could not open directory: C:\Users\PC\AppData\Local\Temp\opencv) in glob_rec, file e:\cv4.0\opencv\modules\core\src\glob.cpp, line 267

The callstack error says :

  • _err "could not open directory: C:\Users\PC\AppData\Local\Temp\opencv" const std::basic_string<char,std::char_traits<char>,std::allocator<char> > &

I've initialised it like this:

detector = cv::AKAZE::create();
detector->setThreshold(akaze_thresh);

Is this is the right way to use OpenCL version of AKAZE? If yes, how do I fix the error? If not, how do I use OpenCL version of AKAZE?

Use OpenCL feature detector.

How to use OpenCL based feature detector? According to the source code (here) There is opencl version of AKAZE,FAST and ORB. I want to know how to use them in C++ ?

I tried importing #include <opencv2/core/ocl.hpp> and then I also set cv::ocl::setUseOpenCL(true); and for sanity check I did v::ocl::haveOpenCL()cv::ocl::haveOpenCL(). Doing these I can confirm I've built OpenCV with OpenCL support.

That being said I tried converting all cv::Mat to cv::UMat. Now the program crashes at detector->detectAndCompute(umat, cv::noArray(), kp1, des1);. I'm using AKAZE.

The error on the console is:

OpenCV(4.0.0-dev) Error: Requested object was not found (could not open directory: C:\Users\PC\AppData\Local\Temp\opencv) in glob_rec, file e:\cv4.0\opencv\modules\core\src\glob.cpp, line 267

The callstack error says :

  • _err "could not open directory: C:\Users\PC\AppData\Local\Temp\opencv" const std::basic_string<char,std::char_traits<char>,std::allocator<char> > &

I've initialised it like this:

detector = cv::AKAZE::create();
detector->setThreshold(akaze_thresh);

Is this is the right way to use OpenCL version of AKAZE? If yes, how do I fix the error? If not, how do I use OpenCL version of AKAZE?