View Single Post
  #6   Spotlight this post!  
Unread 10-02-2016, 05:29
jreneew2's Avatar
jreneew2 jreneew2 is offline
Alumni of Team 2053 Tigertronics
AKA: Drew Williams
FRC #2053 (TigerTronics)
Team Role: Programmer
 
Join Date: Jan 2014
Rookie Year: 2013
Location: Vestal, NY
Posts: 195
jreneew2 has a spectacular aura aboutjreneew2 has a spectacular aura aboutjreneew2 has a spectacular aura about
Re: OpenCV C++ Bad file descriptor. USB Lifecam

Yes. I will test it tonight. Thank you for all the help.

I just tried the code you posted and it did not work. This was the error I got.

Code:
VIDIOC_REQBUFS: Cannot allocate memory 
 VIDIOC_QBUF: Bad file descriptor 
 No frame 
 OpenCV Error: Assertion failed (size.width>0 && size.height>0) in imshow, file /home/OpenCVArm/opencv-2.4.10/modules/highgui/src/window.cpp, line 261 
 Unable to stop the stream.: Inappropriate ioctl for device 
 munmap: Invalid argument 
 munmap: Invalid argument 
 munmap: Invalid argument 
 munmap: Invalid argument 
 terminate called after throwing an instance of 'cv::Exception' 
   what():  /home/OpenCVArm/opencv-2.4.10/modules/highgui/src/window.cpp:261: error: (-215) size.width>0 && size.height>0 in function imshow
I cant run the command you gave me because it cant find the command sudo. I used 2168's opencv library's. I'm not sure if that makes a difference. I moved the videoCapture = cv::VideoCapture(); and .open(0) outside the loop and it makes no difference.

I'm pretty sure it connects to the camera find but it grabs an empty frame for some reason.

Thanks.

Last edited by jreneew2 : 10-02-2016 at 16:47. Reason: Added info and reply