void computeDescriptors( const cv::Mat& image, std::vector<cv::KeyPoint>& keypoints, cv::Mat& descriptors) { std::vector<float> d; cv::gpu::GpuMat imgGpu(image); cv::gpu::GpuMat descriptorsGPU; try { orb_(imgGpu, cv::gpu::GpuMat(), keypoints, descriptorsGPU); // No option to use provided keypoints!? } catch(cv::Exception &e) { UERROR("GPUORB error: %s \n(If something about matrix size, the image/object may be too small (%d,%d).)", e.msg.c_str(), image.cols, image.rows); } // Download descriptors if (descriptorsGPU.empty()) descriptors = cv::Mat(); else { Q_ASSERT(descriptorsGPU.type() == CV_8U); descriptors = cv::Mat(descriptorsGPU.size(), CV_8U); descriptorsGPU.download(descriptors); } }
void detectKeypoints(const cv::Mat & image, std::vector<cv::KeyPoint> & keypoints, const cv::Mat & mask = cv::Mat()) { cv::gpu::GpuMat imgGpu(image); cv::gpu::GpuMat maskGpu(mask); try { orb_(imgGpu, maskGpu, keypoints); } catch(cv::Exception &e) { UERROR("GPUORB error: %s \n(If something about matrix size, the image/object may be too small (%d,%d).)", e.msg.c_str(), image.cols, image.rows); } }
void OrbDescriptorExtractor::computeImpl(const cv::Mat& image, std::vector<cv::KeyPoint>& keypoints, cv::Mat& descriptors) const { cv::Mat empty_mask; orb_(image, empty_mask, keypoints, descriptors, true); }