2
我正在用OpenCV做CUDA處理來自usb網絡攝像頭的livestream。目前我在做這樣的事情:是否有可能從usb網絡攝像頭直接讀取到gpu內存
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
獲取它?