Kinect open source driver demo

yet another one;a=summary

awesome how quickly that worked out! 8) …

I’m seeing four different projects already: (i hope this guy doesn’t forget to clone to github, as per the adafruit bounty requirements)

theo has it running in os x now

the data looks really good, i decoded some of it:

Oh shiiii—!!

Is the code on github anywhere or just the zipfile?

Picking up a Kinect today :wink:

this is almost too exciting :slight_smile:

joshua noble and i made some modifications to glview.h tonight to get a live ‘house of cards’ style point cloud from the kinect.

ok. I need a kinect.

try putting this:
color_ptr = &gl_rgb_front[i\*640\*3+j\*3];
glColor3b(color_ptr[0], color_ptr[1], color_ptr[2]);

before the vertex call :slight_smile:

@null, nice :slight_smile:

also, null, it’s an unsigned byte so you have to use ub. and if you have an rgb sequence you can use ubv:

	for(i = 0; i < h; i ++) {  
		for(j = 0; j < w; j ++) {  
			int k = i * w + j;  
			uint8_t* color_ptr = &gl_rgb_front[k*3];  
			glVertex3f(j, i, gl_depth_front[k*3]);  

I put together a prelim ofxKinect … the layout and code are there but libusb dosen’t seem to call the callback functions form within the thread I’m using. Take a look and see if I’m missing something somewhere.

It uses the libfreenect code that Theo got working and includes a precompiled 32 bit libusb (minus Theos additions). Perhaps the missing additions are the problem? I don’t know as I don’t know what he changed. The internals should be easy enough to update as the libfreenect/openkinect lib api changes.

you will need my changes for sure.
the zip I posted has my libusb - if you build that for 32bit and use the .a from that ( making sure to reaname it first from libusb.a to usb.a ) you should be good to go.

Hi all
I wasn’t able to resist and I’ve just bought one,
really promising device :slight_smile:
are you already working out a way to avoid glitches on osx?

check the patch here:
makes it 100% stable…-a42e86cc9f

ah, so close… how hard is it to recompile theo’s libusb mods as 32-bit instead of compiling from the libusb source directly?

if i understand correctly, ofxkinect almost works, but not quite yet, probably because these mods are missing?

also, for an idea of what the above code does check out:

[quote author=“theo”]check the patch here:
makes it 100% stable…-a42e86cc9f[/quote]

thanks a lot, I am going to try

also, i’ll be posting any info i find to the github wiki rather than here. an important followup to the last post about disparity values, if you want to convert the raw 11-bit data to depth in meters use the function here

@kylemcdonald, looks really good. How are you projecting the rgb image on to the points from the correct angle?

@null, i’m not doing anything special to project the points correctly.

what should happen is this:

1 rectify the rgb image to the depth image
2 use the disparity (raw 11-bit value) as an x offset when looking up the rgb value for a given pixel

the scaling factor on the x offset is based on the distance between the depth cam and rgb cam, but you’ll have to figure it out empirically/by messing around.

Okay so here is the fixed ofxKinect that Dan uploaded.
lots of small fixes and cleanup - code is up to date with the openkinect github and some buffer size issues have been addressed.

grab it here for 0061 Mac
EDIT - updated file with correct depth mapping and removed linker flags!

From now on, to get the latest - go to and click on the Download button which will zip up the latest github version for you.

Note for newcomers to OF - grab the appropriate 0061 release from the downloads page ( ) and unzip the ofxKinect zip inside of the apps/examples/ folder of the 0061 release.


**Also the original libfreenect osx project with all the updates and 32bit libusb