我有兩個不同的相機。我使用下面的簡單代碼,我得到一個錯誤。在這個網站上有類似的問題,但沒有一個被接受的答案。該錯誤消息是:libv4l2錯誤:設備上沒有剩餘空間
libv4l2: error turning on stream: No space left on device
VIDIOC_STREAMON: No space left on device
OpenCV Error: Assertion failed (size.width>0 && size.height>0) in imshow, file
/home/OpenCV/opencv-2.4.10/modules/highgui/src/window.cpp, line 269
代碼:根據我對web.I搜索沒有爲這個測試
VideoCapture cap(2);
VideoCapture cap2(1);
if(!cap.isOpened()) // check if we succeeded
{
cout << "Webcam cannot open!\n" ;
return -1;
}
if(!cap2.isOpened()) // check if we succeeded
{
cout << "Webcam2 cannot open!\n" ;
return -1;
}
namedWindow("Window1", CV_WINDOW_AUTOSIZE);
namedWindow("Window2", CV_WINDOW_AUTOSIZE);
for(;;)
{
iKey = waitKey(5);
if (iKey == ESC) { break; }
cap >> frame;
cap2 >> frame2;
imshow("Window1", frame);
imshow("Window2", frame2);
}
EDIT 1 這些相機中使用相同的輪轂和輸出如下。我不明白我應該如何解決這個問題。
sudo cat /sys/kernel/debug/usb/devices | grep "B: "
B: Alloc= 0/900 us (0%), #Int= 0, #Iso= 0
B: Alloc= 37/900 us (4%), #Int= 2, #Iso= 0
B: Alloc= 0/900 us (0%), #Int= 0, #Iso= 0
B: Alloc= 0/900 us (0%), #Int= 0, #Iso= 0
B: Alloc= 0/900 us (0%), #Int= 0, #Iso= 0
B: Alloc= 0/900 us (0%), #Int= 0, #Iso= 0
B: Alloc= 0/800 us (0%), #Int= 0, #Iso= 0
B: Alloc= 0/800 us (0%), #Int= 0, #Iso= 0
我沒有USB 3.0端口:) – zumma 2015-09-21 12:45:45