Cuda ORB Descriptors problem

asked 2018-01-19 03:59:41 -0500

Andrea gravatar image

I am trying to make a feature matching algorithm with OpenCV on CUDA. I am using the ORB features. The main problem I have is that I am able to well compute the ORB keypoints but the descriptors are always empty. I tried all the ways but without success. I tried with the last version of opencv (3.4.0) and the 3.2.0 version. This is the simplified version of my code:

cv::Ptr<cv::cuda::ORB> orb_gpu = cv::cuda::ORB::create(5000);
std::vector<cv::KeyPoint> keypoints;
cv::cuda::GpuMat descriptors;
cv::cuda::GpuMat img_gpu(curr_frame);
orb_gpu->detect(img_gpu, keypoints); 
orb_gpu->compute(img_gpu, keypoints, descriptors);
cv::Mat desc_cpu;
descriptors.upload(desc_cpu);
edit retag flag offensive close merge delete

Comments

i don't have CUDA, but wouldn't it be something like:

descriptors.download(desc_cpu);

? (upload is used, to get stuff from cpu to gpu, so the other direction)

berak gravatar imageberak ( 2018-01-20 10:04:27 -0500 )edit