Dual Kinects

Is it possible to connect 2 (or more) Kinects with openFrameworks? I was watching these videos of Robert Hodgin speaking and he mentions that Cinder can handle 2



I added multiple camera support to ofxKinect. Please try the feature-multiple-kinect branch and test: https://github.com/ofTheo/ofxKinect/tree/feature-multiple-kinects

It’s tested and working on Mac, Win, and Linux.

A static freenect context is shared between ofxKinect instances that manages which ids are being used for you. No current code should be broken. You can now specify the device id in ofxKinect::open or leave it blank to have it use the first available. There are also some id and number of device static functions.

awesome dan!

has anyone had luck with >2 kinects on one machine? We have tried with a few projects, but it seems like it’s a USB issue and that perhaps adding PCI USB cards could help?

Wonder if anyone has had success getting this to work.

I am running 4 kinects on one machine.


@eight you should post some more info on your machine specs, including what OS, what addon, what USB card/cards or motherboard you’re using. i think >2 kinects is something a lot of people are interested in.

Kyle, since I should, here it goes: I am using Cinder kinect block, which supports multiple devices out of the box, on a desktop with OS X Lion. I slightly modified the code to hard code 4 devices. The motherboard has two internal USB controllers, which are driving 2 kinects. I bought 2 additional generic PCI usb controller cards to support the other two kinects. At this point I tested this to only get the rgb and d images, since I am not interested in skeletons. I will be happy to post my code, if there is interest, and as soon as I get to the venue.



Yes some sample code would be great.
Thanks in advance.

@eight, awesome, thanks! good to know libfreenect can handle 4 on a decent machine so long as each kinect has its own usb controller. rgb+d on every kinect, impressive!

Here is a Cinder-kinect block’s sample, modified for 4 devices: http://post.scriptum.ru/svalka/cinder/kinectBasic4.zip (OS X). It was taken out of Cinder/blocks/Cinder-kinect/samples directory. (current github version of Cinder and of Cinder-kinect).

Here is a photo of 4 kinects producing 4 depth images:


I’d be curious what about the specifics of the machine you’re running it on and the performance that you’re seeing while running 4 of them at the same time.

Quad core q9400, OS X 10.6.8, 8gb RAM. I haven’t noticed any slowdown due to running 4 kinects, so I haven’t collected any performance measures. If you tell me what measures specifically you are interested in, I could get them when I am at the venue.