Tuesday, June 3, 2014

Kinect for Ubuntu

Introduction 
Kinect sensor provides raw color image frames from the RGB camera, depth image frames from the depth camera, and audio data from the microphone array to the SDK. Kinect is versatile, and can see people holistically, not just smaller hand gestures. Six people can be tracked, including two whole skeletons. The sensor has an RGB (red-green-blue) camera for color video, and an infrared emitter and camera that measure depth. The measurements for depth are returned in millimeters. The Kinect sensor enables a wide variety of interactions, but any sensor has “sweet spots” and limitations. With this in mind, Kinect team defined its focus and limits as follows:
Physical limits – The actual capabilities of the sensor and what it can see.
Sweet spots – Areas where people experience optimal interactions, given that they’ll often have a large range of movement and need to be tracked with their arms or legs extended.

 Fig 6.1 : Near Mode Depth Range

 Fig 6.2 Default mode depth range

 Fig 6.3: Angle of Vision (depth and RGB)

 Fig 6.4: Skeleton Tracking

 Fig 6.5: Full Skeleton Mode

 Fig 6.6: Seated Mode


Kinect is unique because its single sensor captures both voice and gesture, from face tracking and small movements to whole-body. The sensor has four microphones that enable our application to respond to verbal input, in addition to responding to movement.


Fig 6.7: Audio Input

 Fig 6.8: Microphone Array

 Fig 6.9: Sound Threshold

 Fig 6.10: Directional Microphone


Fig 6.11: Loudest source targeting 

Fig 6.12:  Kinect with its sensor


Installing Kinect in Ubuntu 

Quick copy-paste instructions to get up-and-running instantly:
sudo apt-get install git-core cmake freeglut3-dev pkg-config build-essential libxmu-dev libxi-dev libusb-1.0-0-dev
cd libfreenect
mkdir build
cd build
cmake ..
make
sudo make install
sudo ldconfig /usr/local/lib64/
sudo glview
To use Kinect as a non-root user do the following:
sudo adduser $USER video
Also make a file with rules for the Linux device manager:
sudo nano /etc/udev/rules.d/51-kinect.rules
Copy and paste:
# ATTR{product}=="Xbox NUI Motor"
SUBSYSTEM=="usb", ATTR{idVendor}=="045e", ATTR{idProduct}=="02b0", MODE="0666"
# ATTR{product}=="Xbox NUI Audio"
SUBSYSTEM=="usb", ATTR{idVendor}=="045e", ATTR{idProduct}=="02ad", MODE="0666"
# ATTR{product}=="Xbox NUI Camera"
SUBSYSTEM=="usb", ATTR{idVendor}=="045e", ATTR{idProduct}=="02ae", MODE="0666"
# ATTR{product}=="Xbox NUI Motor"
SUBSYSTEM=="usb", ATTR{idVendor}=="045e", ATTR{idProduct}=="02c2", MODE="0666"
# ATTR{product}=="Xbox NUI Motor"
SUBSYSTEM=="usb", ATTR{idVendor}=="045e", ATTR{idProduct}=="02be", MODE="0666"
# ATTR{product}=="Xbox NUI Motor"
SUBSYSTEM=="usb", ATTR{idVendor}=="045e", ATTR{idProduct}=="02bf", MODE="0666"
Be sure to log out and back in.
If you can't access or still need root privileges to use your device: in some cases there might be conflicts between permissions of two drivers installed (libfreenect and primesense). If this is your case, try reinstalling primesense's sensor driver and keep only primesense's rules file /etc/udev/rules.d/55-primesense-usb.rules, removing the /etc/udev/rules.d/51-kinect.rules file if you created it.
Testing Kinect in Ubuntu
You need to do this as root (or use sudo) if you did not follow the "Use as normal user" steps.
$ bin/freenect-glview
or
$ sudo bin/freenect-glview
 

Fig 13: Kinect tested in Ubuntu

No comments:

Post a Comment