Forums > MaxMSP

Drawing undistorted point cloud with jit.openni

December 6, 2013 | 7:31 am

Hi All,

I’m interested in using diablodale’s lovely jit.openni object to draw point clouds from a Kinect. I have a working patch but it seems that I need a method for undistorting the depth field:

<code>

– Pasted Max Patch, click to expand. –

</code>

Does anyone have a working example that draws an undistorted point cloud using jit.openni?

I’m familiar with dtr’s handy methods for undistorting the depth field produced by jit.freenect.grab – but I was not able to easily translate those techniques. I thought that undistorting was not needed with jit.openni, but perhaps I am missing something.

Here is a screenshot showing what my patch currently produces – curved walls, ceilings, etc. – lovely to look at, but inaccurate!

http://jts3k.com/other/miscellany/curved_walls.png

Any thoughts would be most appreciated!


December 6, 2013 | 11:29 am

Just use dp.kinect. It can output point clouds automatically. If you are on Macintosh, however…

The data that is returned from jit.openni is undistorted. All of the math is done by OpenNI to give you real world x, y, z in millimeters in joints. And in the depthmap, the Z is undistorted, but the X and Y are in screen/pixel space and need to be transformed into real-world X, Y.

jit.freenect.grab returned distorted data and needed code to derive x, y, and z from its depthmap. This exact same code can’t be used on jit.openni because its z data isn’t distorted.


December 6, 2013 | 12:04 pm

Thanks Dale! Alas, I am working on a Mac. Can you point me towards any examples for transforming the XY space to real-world XY?


December 6, 2013 | 2:19 pm

PCL can be one resource for you http://pointclouds.org/


Viewing 4 posts - 1 through 4 (of 4 total)