After 5 days of pulling my hair out, I need to appeal to this group. I am trying to get a beaglebone up and running with a webcam and opencv. Looks like lots of people are. I had this running on a BeagleBoard but cannot get it to work on the bone. I’ve read many theories including: there is no port for uvcvideo for beaglebone and there is an issue with USB DMA. Anecdotally, I’ve read of people getting it to work. But, no matter what I try, no joy.
The good stuff:
the usb cameras (I’ve tried many) appear in dmesg and lsusb
I see /dev/video0
My OpenCV code compiles without complaints
the mplayer test works
The bad stuff:
Open CV “facedetect” sample gives me “Capture from Cam 0 didn’t work” no matter what I do
So here’s my request: can someone suggest a sure-fire way to be up and running with beaglebone, webcam and opencv? I’m willing to change linux distributions, webcams, etc. DSP would be nice and disabling USB DMA isn’t desirable.
I haven’t tried the April 10th version yet. I narrowed down my problem to a missing or bad uvcvideo module but didn’t see a reference to anything in the change log. Has the uvcvideo module been ported to the bone yet?
Thank you for the background both of you. The problem I was experiencing was that uvcvideo would not show in lsmod even though /dev/video0 would appear and dmesg showed a new device. If the latest image includes a disabled DMA and a disabled DMA will allow uvcvideo to load correctly, that sounds encouraging. Did I understand things correctly?
Sean,
The reason that uvcvideo does not show up with lsmod is that the uvcvideo code is compiled into the kernel, rather than a separate module. My opinion is that DMA is highly desirable with streaming video, as the processor has enough to do elsewhere Unfortunately, as enabling DMA kills video streaming completely, then disabling it is the lesser of two evils. I am puzzled as to why other USB devices, such as memory dongles, appear to work fine with DMA enabled! HTH, Dave. On 04/13/2012 09:00 AM, proc_rock wrote:
I’ve tried: http://dominion.thruhere.net/koen/angstrom/beaglebone/Angstrom-Cloud9-IDE-GNOME-eglibc-ipk-v2012.04-core-beaglebone-2012.04.13.img.xz and it installs ok, However, I’m getting a failure to capture image from webcam in OpenCV, using the function cvCaptureFromCAM(). This is a few layers removed from the raw webcam capture - can you suggest a command line test (I’m in a console setting) of the webcam so I can tell whether it is OpenCV or the raw capture that is giving me grief? e.g. something that will write to an jpeg or avi file?
As it’s title says, it’s about getting image data from the V4L2 interface in Linux. It contains (a link to) code that when compiled will open the camera and create one jpeg of the first frame it sees.
You can modify the code to read image data from the webcam and pass it on to an OpenCV array. That’s what I did in a previous version of the distro, and that worked mostly fine apart from the DMA bug. I’ve yet to try that on the new release as I’ve just returned from a holiday, but I expect it should work fine.
(Incidentally, on that previous distro, I didn’t get cvCaptureFromCAM working either. But since I had code to access image data anyway, it wasn’t a problem).
I just downloaded and compiled it and it compiled without warnings. I got some really interesting results across 4 different cameras. Two gave me “select timeout” (logitech and microsoft, uvcvideo), one gave me “segmentation fault” (gspca) and another (Genius, uvcvideo) gave me an image (bad quality, but I think that might be because the gain maybe didn’t have enough time to adjust.
I wonder why all the differences. OpenCV still gives me errors when I use the webcam that works. I might need to go back to the beagleboard where things seem to work ok. I’m anxious to get this up and running on the beaglebone but maybe I need to give it some time.
I used a Venus USB 2.0 webcam (which apart from the occasional “select timeout”, which I hope is due to DMA, worked absolutely fine) and a Trust Spotlight (same “select timeout” issue, but also, a few images- 6 out of 100- were “shifted”, with what should have been upper left ending up down right, for example).
The version of Angstrom I used and and which partially worked was the 14Feb2012 one, so I know the cameras are all right, and that the program I use to get images from them should be ok also. What’s different, and USB camera-related, between the 14Feb2012 release and the new one?
If I recall correctly this is right about when some changes went into the video stuff. I don’t recall now exactly which changes, but shortly before this I had and OpenCV/kernel/Angstrom image that worked together and then went through a few weeks of everything broken.
I would either go back to an older version or update to a newer one (I think I started getting working images around the second week of March).