Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Simple GPU access tutorials with OpenCV

Forgive the broad OpenCV/C++/CUDA/GpuMat question, but does anyone know of a simple tutorial for converting an OpenCV Mat image file to a GpuMat? I've spent the entire weekend looking around, and it appears that the OpenCV GPU functions have changed a lot over time, and tutorials from a few years ago no longer apply.

And compound that with the challenge of setting up CUDA and OpenCV and CMake in a Visual Studio C++ so that you also have GPU support and it's time to tear your hair out.

The closest I've come is this, although this is like the 5th syntax I've tried from different tutorials. It compiles and links okay, but crashes with a "no CUDA support" error:

using namespace cv;
Mat image = imread("d:\\documents\\renders\\img.bmp");
cuda::GpuMat gI; // GPU matrix - for now empty
gI.upload(image); // Upload a data from the system memory to the GPU memory

Thanks much for any help