Go to Post Greetings FIRST: THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU. - Tetraman [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 09-02-2016, 19:48
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: 192
jreneew2 has a spectacular aura aboutjreneew2 has a spectacular aura aboutjreneew2 has a spectacular aura about
OpenCV C++ Bad file descriptor. USB Lifecam

Hello all, I am having an issue with the USB Lifecam and getting an image to an an openCV mat. My code works fine with an axis camera, but because ours broke a couple days ago I am trying to get the USB camera to work with the code. It opens the stream fine, but ends up with a width and height of zero. The error log is:

Code:
IM AM IN PROCESS IMAGE! 
VIDIOC_QBUF: Bad file descriptor 
Unable to stop the stream.: Bad file descriptor 
munmap: Invalid argument 
munmap: Invalid argument 
munmap: Invalid argument 
munmap: Invalid argument

Here is our code:
Code:
//				opens up the camera stream and tries to load it
			videoCapture =  cv::VideoCapture();
//				replaces the ##.## with your team number
			videoCapture.open(0);
//				Example
//				cap.open("http://10.30.19.11/mjpg/video.mjpg");
//				wait until it is opened
			while(!videoCapture.isOpened()){
				printf("videoCapture could not open!\n");
			}
//				time to actually process the acquired images
			processImage();
processImage:
Code:
 		videoCapture.read(matOriginal);
 		if(matOriginal.empty()) {
 			break;
 		}
Im not really sure why but it seems like the image is empty. I tried putting the image grabbing in a loop, because I hear it could take a while to grab an image. However, no dice.

I'm really hoping someone else has had a similar issue because our team cannot afford another axis camera.

Thanks,

Drew

Last edited by jreneew2 : 09-02-2016 at 19:53. Reason: added info
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 09:36.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi