Installing
OpenNI in Ubuntu 14.04
Few month ago, I saw a video , doing cool staff using Kinect ,
like object tracking , localization etc . So I bought a Kinect from eBay and start to
code. Before going on to detail of it is really necessary to
understand the physics behind the Kinect to get optimum use .
What is a Kinect?
Kinect is a device which was originally build as plug-in device
for XBOX gaming. it is use to acquire detail ,color, width, height and also the
depth in the range of 20 inch to 20 feet approximately ,using a inferred net projecting towards to the front
object . height ,width and color details are taken using the RGB
camera mounted in it and the depth detail taken using Depth camera which is
generating depth values for each pixel comparing the inferred net
projected and reflected inferred net which has
defected due to the depth and curvature of the facing objects.
There are few iteration of Kinect sensor have made. But newer sensors
are using different techniques to acquire the depth value. I used xbox360 1414
module (see the bottom of Kinect sensor) which has good compatibility with the
OpenNI libraries, if you are purchasing now check before the compatibility of
OpenNI or any other library that you planning to use, and also there is a
module called xbox360 1413 which is a later iteration as I heard it has some
issues with OpenNI library due to hardware change,better check it out before purchasing .
I dig little bit deeper to understand the hardware level . So I found this
video on youtube. Check it out if you are real like to know what inside the
casing.
USB power
Adapter
Kinect come with its own USB power adapter because Kinect need
considerable amount of power which cannot supply through the directly from USB
connection. If you try without power adapter you will probability get error message like,
No Kinect connected...
Make sure that you have both component with you.
Power adapter has Y connection at the wire end. At one end there
is male USB connector head and the other end has female head which is
compatible with the Kinect out coming wire head. And also the little LED green
indicator on the Y joint of the wire so that you can check the power Adapter
and power supply.
Interfacing
with computer
As I mention before Kinect was originally build and introduce
for Xbox. After few times of release, programmer’s hackers realized that this
device could use more than gaming , all kind 3D sensing they couldn't do before, still at that time
there was no drivers compatible with computer . So OpenNI drivers were
build to fill the gap. Few years after
windows introduce Kinect Studio for free use to the computer. You can use them
also if you are using Windows. Kinect studio easily interface with VB, I haven’t try that yet
although I run example provided in Kinect studio.
You can download Kinect Studio latest version from here.
OpenNI
OpenNI is a one of most powerful 3D vision base middle-ware free available in the Internet. Basically Until 2013,PrimeSense
company had developed open source libraries (OpenNI, NITE) for Kinect but In 2013, Apple
bought PrimeSense and despite OpenNI is still
open source, NITE2 is no more available for developers which is used for
applications such as skeleton, hands, object, gesture tracking. Without NITE,
just with libraries OpenNI1.5, you can just control utilities like depth view,
LED light and camera motor. But still
the last versions of NITE 2.2.0.11 is available in the Internet.
Here on wards I will explain to install OpenNI and NITE into the the processing
1) Installing
OpenNI and NITE
(i)
I highly recommend you to
install 32bit version of the OpenNI although you are running on 64bit machine.
Because I tried the 64 bit version but it didn't work out for me. I tried to
resolve the problem in various way but it path to nowhere. Also checked the
issues on various forum and all suggest to use 32 bit version instead of 64
bit version.
(ii)
First download OpenNI-NITE installer package
from here and extract it.
(iii)
Navigate to the extracted folder OpenNI-Bin-Dev-Linux-x86-vx.x.x.x then
install it using sudo ./install.sh command as below. If you are
using build command first time it will
probably crash and stop the installation. If so go to the error message. It
will probably say missing command or library. First in install particular library related to the command and run it again.
(iv)
Then navigate to the
NITE-Bin-Dev-Linux-x86-vx.x.x.x and
install it using sudo ./install.sh
(v)
Finally Kinect folder and then to the
Sensor-Bin-Linux-x86-vx.x.x.x and install it also using sudo ./install.sh
(vi)
Now necessary library installation is over .
(vii)
To check whether the installation is correct First plug in the
Kinect to computer and plug in the power supply and then navigate into the
OpenNI-Bin-Dev-Linux-x86-vx.x.x.x ->
Samples -> Bin -> x86-Release run the example NiViewer using ./NiViewer
command
If All steps are done
correctly you will see window with depth image and the color image together as
following. Also you can try other example also.
2) Configure
with processing
Processing is one of most powerful and simple open source
language integrated development environment among visual design communities
which can easily be used to analyze and process graphical data Because it is
free and tons of free libraries are available for various visual task.
Also there are few library regarding Kinect data processing. In
this tutorial what I trying to use is SimpleopenNI library which is actually so
far very good. Unfortunately at this time SimpleopenNI does not support later
release version of processing. But older version of processing works fine. I actually
use processing 2.2.1 version for my projects.
(I) You can download processing 2.2.1 from below link http://download.processing.org/processing-2.2.1-linux32.tgz
If you trying to use later version of processing check whether
SimpleopenNI library is supporting for that.
(II) After downloading unzip the downloaded folder and navigate
to the inside the folder and run ./processing
Processing window
will appear
(III) Then goto Sketch > Import Library... >Add Library then the below window will appear
(III) Then goto Sketch > Import Library... >Add Library then the below window will appear
(Because of I
already downloaded the library button is appear as Remove in your case it will be install )
Click the button
to install it then it will automatically download necessary files and it will configure with your processing
libraries.
(V) Now configuration
is done.
Now test it.
TEST
TEST
1. First plug in the Kinect to your computer
also power supply to the Kinect.(now green light in front should blink)
2. then open processing
Navigate to File > Examples... >
SimpleOpenNI > DepthImage (You can
any of other example under SimpleOpenNI) and Run it
If you run Depth-image example
Following window with gray scale depth Image and the normal color image will appear
Comments
Post a Comment