0
$\begingroup$

Rosanswers logo

Hi, atm my goal is to connect several standard USB webcameras (2-4) to one single computer and try to run/record them at the same time. I'm using MSVS with C++ and the openCV libraries. Getting data from one single camera just works fine.

cv::VideoCapture vidCap(0); 
if(vidCap.isOpen())
    cout << ...     

this just works fine and i can record pictures. But if I trie to set up an other VideoCapture object:

cv::VideoCapture vidCap2(1);
if(vidCap2.isOpen())...

it allways fails! I tried to run it in different threads, but this didn't work either - even got a bluescreen after closing the programm. And even with some software tools like Dorgem I got a bluescreen after trying.

I'm using Windows 7 64bit as operating system.

Any clues about what could be wrong here? I'd be happy about any help.


Originally posted by wtom on ROS Answers with karma: 1 on 2012-05-24

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

Hi.

First of all, your problem is an OpenCV problem so I would think you might have better luck asking in the OpenCV group: http://tech.groups.yahoo.com/group/OpenCV/

Secondly, as pointed out here (http://stackoverflow.com/questions/10194033/opencv-with-2-cameras-vc) OpenCV does not seem to handle >1 USB cameras on Windows all that well in general.

One suggestion would be to try something different. For example, you could try to actually use ROS to communicate with the cameras and set them up as ROS topics. Then create a node that subscribes to the images and does whatever OpenCV processing you need to do. There's no guarantee this would work, but it's worth the shot I'd think.

Kind regards, Stefan Freyr.


Originally posted by StFS with karma: 182 on 2012-05-25

This answer was ACCEPTED on the original site

Post score: 2


Original comments

Comment by mjcarroll on 2013-01-17:
You may also find the OpenCV equivalent of ROS Answers helpful: http://answers.opencv.org/questions/

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.