Reputation: 63
I'm trying to use OpenCV 4.1 with CUDA 10 to resize lots of large tif stacks, but VS2017 doesn't see the function resize
in the library. It's happy with a subset of the cv::cuda
library, but doesn't see all the functions as listed here: https://docs.opencv.org/4.1.0/d1/d1a/namespacecv_1_1cuda.html
I'm including #include <opencv2/opencv.hpp>
, and Intellisense shows me the autocompletes of cuda::
of PtrSz, registerPageLocked, resetDevice, setBufferPoolConfig
, but no resize...?
I adapted the old OpenCV 3(?ish; here https://www.opencv-srf.com/p/introduction.html) tutorial online to setup my VS project:
$(OPENCV_DIR)\include
$(OPENCV_DIR)\x64\vc15\lib
here, and below, I've changed the vc## folder to reflect that I'm using VS2017PATH=$(OPENCV_DIR)\x64\vc15\bin;%PATH%
opencv_world410d.lib
opencv_world410.lib
If I try to compile using cv::cuda::resize(...)
I get the compile error of namespace "cv::cuda" has not member "resize"
. If instead I try to use one of the functions it sees in that namespace, e.g. std::cout << "CUDA device count: " << cuda::getCudaEnabledDeviceCount();
it outputs CUDA device count: 0
and trying something like std::cout << "CUDA device: " << cuda::getDevice();
gives the following error:
OpenCV(4.1.0) Error: No CUDA support (The library is compiled without CUDA support) in throw_no_cuda, file c:\build\master_winpack-build-win64-vc15\opencv\modules\core\include\opencv2\core\private.cuda.hpp, line 107
I'm confused, firstly, why it only sees a subset of the functions available in that cv::cuda namespace, and secondly, why I don't have CUDA support? Do I need to compile OpenCV on my machine first?
Upvotes: 3
Views: 1891
Reputation: 1502
Make sure you are including the proper header files. In your case cudawarping.hpp should be the right one. Most likely you like to do some matrix arithmetic as well so you need to include cudaarithm.hpp .
#include <opencv2/cudaarithm.hpp>
#include "opencv2/cudawarping.hpp"
Here is the api documentation to resize: Documentation
Hope it helps...
Upvotes: 1