There have been a few versions of Kinect wrappers for LabVIEW circulating since the original release of the Kinect. Many had advantages others did not (I, personally, wrote one of them), but none take advantage of the new upgrades to the Microsoft Kinect API (which actually broke some previous versions of the Kinect API). The library outlined here gives much of the basic functionality users are looking for when using the Kinect.
-Get information on any Kinect Devices attached to the computer.
-Connect to any of a number of Kinects attached to the computer.
-Get the Color Images from the Kinect in any of the supported formats.
-Get the Depth Images from the Kinect in any of the supported formats.
-Get the approximate location of a speaking user using the Kinect Audio API.
-Set the angle of elevation of the Kinect.
-Basic error handling.
-Get the RAW audio information from the Kinect Microphones
-Get the Skeletal frame from the Kinect (this feature was started, but is incomplete - completing the VI is left as an exercise to the user).
-Perform speech recognition automatically using the API.
The VIs are documented internally but are outlined breifly here. The example VI is provided which is also explained here.
This software requires NI Vision Acquistion Software (specifically NI IMAQ) which can be downloaded for free from ni.com/drivers.
This software was constructed in LabVIEW 2011 SP1 and requires the .NET 4.0 configuration file to have been set for LabVIEW (see this article on how to do that).
The front panel consists of a settings panel on the left which demos some basic features including the ability to select a specific Kinect, Color Image Format and Depth Image Format. The approximate location of the user based on the sound the produce is revealed on the bottom as well as the confidence and the beam angle. Unlike with previous iterations involving the .NET API, this package does not crash as a result of hitting the Abort button instead of the Stop button (as is recommended to avoid memory leaking).
As we can see, the block diagram follows a very simple structure familiar to all of us. The first VI gets the information on the Kinects we have connected to the machine (this has only been tested with one Kinect as it's all I have). The second initializes a connection to the selected Kinect (typically Index 0) and selects the resolutions we want. The next three VIs perform some example movements of the Kinect's tilt motor. Notice the min and max range are populated in the Get Device Info.vi function.
The loop repeatedly gets the color frame, depth frame and audio information. The Dispose function stops all sensors and the Kinect and clears any internal errors we created (leaving only non-handled errors).
Note the delay we left in the loop. This prevents the color and depth frames from repeatedly throwing errors from being called too fast. You can tweak this speed to your preference, but if called too quickly, the Get functions will return non-fatal errors.
The disabled area within the block diagram is a short attempt to get the Skeletal Frame. It is not working and not tested, but provided as a starting point for those considering pulling this information.
The wrapper provides a session wire which can be called using a property node to get some basic information. These values cannot be written with a property node, but write functionality is included in the form of VIs which can be found in the Kinect Session class.
Remember you must install the Microsoft Kinect API in order for this package to work. Additionally, this has not been tested on a 64 bit machine. You may need to remap the DLL reference in order for this to work.