First time here? Check out the FAQ!

Ask Your Question
1

4 Cameras Simultaneously

asked Aug 19 '13

Steve gravatar image

updated Aug 21 '13

Hi, Based on this tutorial,

Is it possible to run this code by using 4 cameras simultaneously and save all 4 results separately? How?

(It would be great if somebody knows the solution in Java ,if not, C++ version also will be helpful)

Thank you in advance.

Preview: (hide)

Comments

Just a remark. In the future, try using tags without hashtags to it. It creates unneccesary doubles in the tags list, which makes it harder to perform good filtering on this forum. Thanks in advance! I have adapted your tags for this topic.

StevenPuttemans gravatar imageStevenPuttemans (Aug 21 '13)edit
1

@StevenPuttemans I understand, you are right. sorry.

Steve gravatar imageSteve (Aug 21 '13)edit

1 answer

Sort by » oldest newest most voted
2

answered Aug 19 '13

berak gravatar image

well, from the opencv side, it's no problem running multiple cams, it's just like:

VideoCapture cap0(0);
VideoCapture cap1(1);
...

// later:
cap0.read(frame0);
cap1.read(frame1);
...

but reality sucks here, again. the usb bandwidth of a single hub is just enough for 1 cam, if you plug 2 or more into 1 bus, you'll saturate it. you can still reduce the framesize,

cap0.set(CV_CAP_PROP_FRAME_WIDTH,320);
cap0.set(CV_CAP_PROP_FRAME_HEIGHT,240);

and pray, that you got 2 seperate hubs ( try front/back )

good luck!

Preview: (hide)

Comments

1

This is one of the main reasons why research uses ethernet or firewire camera's, since it supports a larger bandwidth and the problem of multiple camera's can be easily addressed this way. Actually in your example there won't be an actual problem in retrieving frames, since your are doing it sequentually. It will however create the problems mentioned if you address both captures at the same time in different threads. Result in sequential case will be that your maximum frame capture rate, will be reduced by half or less, since you switch between both captures and you still have overhead problems.

StevenPuttemans gravatar imageStevenPuttemans (Aug 21 '13)edit
1

@berak Thank you. I could run the code with 2 cameras (no resize or manipulation) and there is no problem. Unfortunately I don't have 4 cameras at the time to test with them.

Steve gravatar imageSteve (Aug 21 '13)edit

Question Tools

Stats

Asked: Aug 19 '13

Seen: 5,639 times

Last updated: Aug 21 '13