Loading
Hey! This thing is still a Work in Progress. Files, instructions, and other stuff might change!

Kinect to STL sketch for Processing

by johngomm, published

Kinect to STL sketch for Processing by johngomm Oct 9, 2011

Description

Here's my Processing sketch to interface with the Kinect and capture the depth data and render it as a solid STL file. I've included controls to adjust two thresholds - near and far. This allows you to set up a "Han Solo in carbonite" type effect.

I am not going to hold your hand through setting up Processing and this write up is In Progress, so if you get frustrated, realize that this might not be for you yet. Until I find a way to streamline posting a standalone application that works (currently it doesn't), this is still only for the persistent.

Until Microsoft publishes the code for their KinectFusion project, this is the best I could do to get a directly printable object without messing around in Blender or MeshLab. It's also my first serious coding effort, so forgive any inelegant code. Yes, the STL files are large (15mb) and the detail is hard for the CupCake to print, but it has the outreach potential for people new to 3D printers to create a unique, personalized object by just posing. Before you ask, the STL doesn't seem to take any less time in skeinforge if you use Blender to remove all duplicate vertices first, so I don't bother.

Recent Comments

view all

The Linux-x32 package does not work. Processing states:

NOTE:
requires openkinect driver (libfreenect.dll)
tested on windows XP, x86
tested with libfreenect: "OpenKinect-libfreenect-3b0f416"
libusb-win32 version 1.2.2.0
#_KINECT_ERROR___#
location: dLibs.freenect.FreenectLibrary.loadLibrary(Unknown Source)
message: Unable to load library : freenect.dll

Not sure why a linux package would require a windows dll, but even after supplying the dll the error remains unchanged.

I was running this on windows7 starter, so there should be a driver for windows at the site I pointed to. I tried making a zip that contained all the files needed to install on another machine, but I couldn't get it working (didn't spend too much time on it though). To be honest, I'm not much of a programmer and the whole thing is quite a kludge. I really wish Microsoft would release the code for KinectFusion so we could all get models from that system.

hello do i need the openkinect drivers if i am running processing for windows and dlibs also theres does'nt seem to be an openkinect driver for windows .what do i do?

kellyr

Liked By

view all

Give a Shout Out

If you print this Thing and display it in public proudly give attribution by printing and displaying this tag. Print Thing Tag

Instructions

You will need a Kinect attached to your computer.
I haven't yet exported the processing sketch into a more stand-alone version, so you'll have to deal with running the source code, but that means you can change it and improve it.
This sketch runs inside the Processing environment, which you can download here: processing.org/
Then you'll need the libraries my script is dependent on:
ToxicLibs: hg.postspectacular.com/toxiclibs/downloads/toxiclibs-complete-0020.zip
PeasyCam: mrfeinberg.com/peasycam/peasycam_101.zip
Freenect Library: github.com/diwi/dLibs/archives/dLibs

And also install the OpenKinect drivers to let your computer talk to your Kinect. You'll need to choose the right option for your operating system: openkinect.org/wiki/Main_Page

Once you have it all set up (yes I know it's a bit of a chore, sorry) run the sketch and use "r" and "f" to adjust the red (far) threshold and "g" and "b" to adjust the green (near) threshold. When you are happy, strike a pose and press "s" to output the STL. This can take a while, depending on your computer's speed, but shouldn't take longer than 5 minutes for the highest resolution setting on a netbook and should be way faster on almost anything else.

Comments

You must be logged in to post a comment.

kbradsha on Jul 26, 2013 said:

The Linux-x32 package does not work. Processing states:

NOTE:
requires openkinect driver (libfreenect.dll)
tested on windows XP, x86
tested with libfreenect: "OpenKinect-libfreenect-3b0f416"
libusb-win32 version 1.2.2.0
#_KINECT_ERROR___#
location: dLibs.freenect.FreenectLibrary.loadLibrary(Unknown Source)
message: Unable to load library : freenect.dll

Not sure why a linux package would require a windows dll, but even after supplying the dll the error remains unchanged.

servitor on Mar 18, 2012 said:

hello do i need the openkinect drivers if i am running processing for windows and dlibs also theres does'nt seem to be an openkinect driver for windows .what do i do?

kellyr

johngomm on Mar 18, 2012 said:

I was running this on windows7 starter, so there should be a driver for windows at the site I pointed to. I tried making a zip that contained all the files needed to install on another machine, but I couldn't get it working (didn't spend too much time on it though). To be honest, I'm not much of a programmer and the whole thing is quite a kludge. I really wish Microsoft would release the code for KinectFusion so we could all get models from that system.

Anonymous on Jan 19, 2012 said:

hello

short question:
anytime i try to run the patch i get this message:

#_KINECT_WARNING_#
location: dLibs.freenect.KinectCore.setDepthBuffer(Unknown Source)
on device: 0
message: FAILED: set depth buffer
message: no device opened

#_KINECT_WARNING_#
location: dLibs.freenect.KinectCore
.startDepth(Unknown Source)
on device: 0
message: FAILED: start depth
message: no device opened

any thoughts on why this happens?

i have everything installed. and i use a mid2010 macbook pro with lion

thanks a lot!

Bastiaan on Feb 29, 2012 said:

The problem is that the dLibs_freenect library currently only works for Windows. This means that this program is Windows-only for the moment as far as I can tell.

3DPrintingSystems on Oct 10, 2011 said:

Please can you contact me brcjackson at gmail dot com

Need some help with this.

triffid_hunter on Oct 10, 2011 said:

kinectfusion runs the 3D scan data through a SLAM (simultaneous localisation and mapping) algorithm with some kalman filtering. The algorithms involved are well known and widely available, just need to be implemented with openkinect.

In the meantime, check out http://youtube.com/activevisio... for a group doing monoslam with only a single standard video camera. A thorough kinect SLAM algorithm could include the video data as well as the 3D map for even more precise scans as well as importing textures onto the 3D model :)

Top