Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Surf_Gpu needs Cuda ?

I'm applying Surf_Gpu algorithm with OpenCv on Qt. When I run the code (here is the critical function):

void surf(Mat img,QString j)
{

int MinHessian=400;
GpuMat imgGpu;
imgGpu.upload(img);
SURF_GPU algo(MinHessian);

vector<KeyPoint> keypointsCPU;
vector<float> descriptorsCPU;
GpuMat descriptors,keypoints;
algo(imgGpu,GpuMat(),keypoints,descriptors,false);

algo.downloadKeypoints(keypoints, keypointsCPU);
 algo.downloadDescriptors(descriptors, descriptorsCPU);
 // from device to host

 string path;
if(j=="requete")
    path = "requete.txt";
else
    path = "SURF/" + j.toStdString().substr(0,j.toStdString().find(".")) +".txt";
FileStorage fs(path, FileStorage::WRITE);
fs << "SURF" << descriptorsCPU;
fs.release();
}

I have the following error message :

OpenCV Error: No GPU support (The library is compiled without CUDA support) in mallocPitch, file /build/buildd/opencv-2.4.8+dfsg1/modules/dynamicuda/include/opencv2/dynamicuda/dynamicuda.hpp, line 126 terminate called after throwing an instance of 'cv::Exception' what(): /build/buildd/opencv-2.4.8+dfsg1/modules/dynamicuda/include/opencv2/dynamicuda/dynamicuda.hpp:126: error: (-216) The library is compiled without CUDA support in function mallocPitch

though I don't explicitely use Cuda... Here are my includes:

#include <stdio.h>
#include <QMainWindow>
#include <QFileDialog>
#include <QImage>
#include <QStandardItemModel>
#include <QItemSelectionModel>
#include <QMessageBox>
// #include <highgui.h>
#include <opencv2/opencv.hpp>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/opencv.hpp>
#include <opencv2/features2d/features2d.hpp>
#include <opencv2/nonfree/nonfree.hpp>
#include <opencv2/nonfree/features2d.hpp>
#include <opencv2/nonfree/gpu.hpp>
#include <opencv2/stitching/detail/matchers.hpp>
// for BFMatcher
#include <opencv2/gpu/gpu.hpp>
#include <fstream>
#include <sstream>
#include <iostream>
#include <QTime>
#include <sstream>
#include <QString>

What shall I need to do to get rid of the error ? Thanks !