Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

No. CUDA optimization is explicit. OpenCV has separate module opencv_gpu, that contains different algorithms implemented via CUDA. User should explicitly call functions from opencv_gpu module to run code on GPU, for example:

cv::Mat img = cv::imread(...);
cv::gpu::GpuMat d_img;
d_img.upload(img); // copy data to GPU memory
cv::gpu::GpuMat d_edges;
cv::gpu::Canny(d_img, d_edges, 50, 100); // call GPU implementation
cv::Mat edges;; // copy data from GPU to CPU memory

And, unfortunately, there is no Python wrappers for opencv_gpu module.