Cuda ORB Descriptors problem

asked Jan 19 '18

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);
Preview: (hide)

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 (Jan 20 '18)edit