Ask Your Question
1

4 Cameras Simultaneously

asked 2013-08-19 06:56:16 -0600

Steve gravatar image

updated 2013-08-21 02:26:03 -0600

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.

edit retag flag offensive close merge delete

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 ( 2013-08-21 02:36:24 -0600 )edit
1

@StevenPuttemans I understand, you are right. sorry.

Steve gravatar imageSteve ( 2013-08-21 17:25:55 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
2

answered 2013-08-19 10:17:46 -0600

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!

edit flag offensive delete link more

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 ( 2013-08-21 02:37:29 -0600 )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 ( 2013-08-21 17:19:59 -0600 )edit

Question Tools

Stats

Asked: 2013-08-19 06:56:16 -0600

Seen: 5,605 times

Last updated: Aug 21 '13