是否可以直接从usb网络摄像头读取到GPU内存

时间:2016-08-29 19:03:16

标签: opencv cuda

我正在使用OpenCV进行CUDA处理来自usb网络摄像头的直播。目前我正在做这样的事情:

cv::videoCapture cap(0);
cv::Mat h_frame;
while(cap.read(h_frame)){
    cv::cuda::gpuMat d_frame(h_frame);
    //process d_frame;
}

是否可以摆脱h_frame并直接阅读d_frame

//Imaginary code
cv::cuda::gpuVideoCapture cap(0);
cv::cuda::gpuMat d_frame;
while(cap.read(d_frame)){
    //process d_frame;
}

甚至直接使用CUDA。我的意思是将相机输出作为字节流(直接发送到GPU)然后通过gpuMat以某种方式获取它?

1 个答案:

答案 0 :(得分:4)

目前不可能。

您需要使用您希望将USB数据捕获到系统内存的任何方法。从那里你可以从系统内存转移到GPU内存。

相关问题