I went through this a few months ago and got nowhere. The problem seems to
be in the uvc driver. To troubleshoot outside of openCV I installed
v4l-utils fswebcam gpicview guvcview and permuted available kernels and
never could get image capture to work for more than one frame. I posted a
thread about it here at the time. I gave up and got another RPi2 for this
project instead. I did have success with Derek Molloy's examples on the
old Angstrom image, but Angstrom is too old and has been abandoned, so I
didn't want to use it.
On Wednesday, February 17, 2016 at 6:29:50 PM UTC-6, joelk wrote:
>
> Has anybody managed to capture video from a usb webcam on a BBB with any
> recent Linux distribution using OpenCV cv::VideoCapture functions?
>
> I'm using a Logitech C615 which works perfectly with OpenCV on x86 PCs and
> on a Raspberry Pi 2 (a little slow but it works) running the latest
> Raspbian Jessie image.
>
> But I haven't yet managed to get anything but completely black images
> running the same program on my BBB. I've tried it with a recent Arch Linux
> image. I've tried Ubuntu 14.04, Debian 7.9 and 8.3 (with a few different
> kernels) from BeagleBoard. Nothing! No problems doing anything else in
> OpenCV -- it can load and display individual images and videos from files,
> just not from the camera. And in all of these installations I can capture
> video from the camera with other programs (using v4l2) -- just not with
> OpenCV.
>
> I've seen Derek Molloy's videos demonstrating use of OpenCV on a BBB --
> but he was running it under Angstrom, and as far as I can see the last
> Angstrom distro was at least 3 years ago.
>
> Any suggestions for something more recent?
>
> By the way, here's a sample of a program that's fails to capture any video
> on the BBB (it displays the frame size and then just gives a series of
> "select timeout" messages):
>
>
> #include <iostream>
>> #include <opencv2/highgui/highgui.hpp>
>>
>> int main(int argc, char *argv[]) {
>> cv::VideoCapture cap;
>>
>> cap.open(0);
>>
>> if(!cap.isOpened()) {
>> std::cout << "Did not connect to camera." << std::endl;;
>> return -1;
>> }
>>
>> double dWidth = cap.get(CV_CAP_PROP_FRAME_WIDTH);
>> double dHeight = cap.get(CV_CAP_PROP_FRAME_HEIGHT);
>>
>> std::cout << "Frame size: " << dWidth << " x " << dHeight << std::endl;
>> cv::namedWindow("MyVideo",CV_WINDOW_AUTOSIZE);
>>
>> while(1) {
>> cv::Mat frame;
>> bool bSuccess = cap.read(frame);
>> if(!bSuccess) {
>> std::cout << "failed to read frame" << std::endl;
>> break;
>> }
>> cv::imshow("MyVideo", frame);
>> if(cv::waitKey(30) >= 0) break;
>> }
>>
>> return 0;
>> }
>>
>
> Can't get much simpler than that.
>
--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.