Reputation: 5659
I have downloaded opencv.exe
provided by the official website. I configured my visual studio 10 as per this video.
Now, I am able to compile and run a simple code given below:
#include <cstdio>
#include <opencv2\opencv.hpp>
int main (int argc, char* argv[])
{
std::cout<<"opencv Version: "<<CV_VERSION <<std::endl;
return 0;
}
Problem: But as soon as I try to include the header for cuda
(i.e. #include "cuda.hpp"
), it throws an error fatal error C1083: Cannot open include file: 'cuda.h': No such file or directory
.
PS: I am able to compile and run a standalone cuda program as shown in this video.
I have checked that cuda.h
is present in the folder C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v7.0\include
.
Upvotes: 0
Views: 5570
Reputation: 5659
If you build OpenCV libraries along with CUDA libraries then, you don't need to set the path of CUDA libraries/headers explicitly. I followed the installation method which is suggested here .
I included the following headers in my OpenCV code and they worked fine.
#include "opencv2\core\core.hpp"
#include "opencv2\core\cuda.hpp"
#include "opencv2\core\cuda\filters.hpp"
#include "opencv2\cudaarithm.hpp"
#include "opencv2\cudafilters.hpp"
#include "opencv2\cudaimgproc.hpp"
#include "opencv2\cudalegacy.hpp"
Upvotes: 2