pynuitrak is a simple Python wrapper for Nuitrack skeleton tracking library. It is intended to be an easy-to-use interface for the Nuitrack library, and thus do not necessarily implements the very same classes as the Nuitrack C++ SDK.
Important: Although this wrapper is free software, Nuitrack is not. You can acquire a trial or pro license at Nuitrack website.
pynuitrack depends on the
Nuitrack SDk
and Boost C++ libraries, version 1.63 or higher.
Nuitrack SDK must be downloaded and
extracted on your workspace, while Boost can be downloaded via your Operating
System (OS) package manager (e.g. apt
) or on
boost website. If your OS supports an
older version of Boost (e.g. Ubuntu 16.04 ships with Boost 1.58), you will need
to download and compile Boost from source.
Download and install Nuitrack for your platform. Make sure that you have acquired a trial or pro license before using it.
After installing Nuitrack, make sure that the environment variables
NUITRACK_HOME
and LD_LIBRARY_PATH
are set correctly by running:
$ echo $NUITRACK_HOME # Should be /usr/etc/nuitrack
$ echo $LD_LIBRARY_PATH # Should include /usr/local/lib/nuitrack
If those variables are not set, open your ~/.bashrc
file in a text editor and
add the following lines:
export NUITRACK_HOME="/usr/etc/nuitrack"
export LD_LIBRARY_PATH={$LD_LIBRARY_PATH}:"/usr/local/lib/nuitrack"
Run nuitrack_license_tool
to register your copy of nuitrack:
$ nuitrack_license_tool
Now download Nuitrack SDK
and decompress it to your working directory. Herein your working directory is
assumed to be your home folder ~/
. Please change it according to your needs.
$ cd ~
$ mkdir NuitrackSDK
$ wget http://download.3divi.com/Nuitrack/NuitrackSDK.zip
$ unzip NuitrackSDK.zip
You probably already have Boost installed on your system. You can check that by running:
$ ldconfig -p | grep libboost
If Boost is not installed, you can install it by running:
$ sudo apt-get update
$ sudo apt-get install libboost*
If the version of the Boost library provided by your distribution is lower than
1.63, pynuitrack won't be able to compile, as it depends on libboost_numpy
.
To download and install boost from source, follow Steps 1 and 5 of the
official instructions.
If you do not want to install the newer version library to avoid breaking your
system (which is a reasonable decision), you can use:
$ ./b2 stage
instead of ./b2 install
as suggested by the official instructions.
Finally, clone this directory:
$ cd ~
$ git clone https://github.com/silasalves/pynuitrack.git
Now open CMakeLists.txt
file and edit line 6 to point to the Nuitrack SDK
directory. If you are using a custom version of Boost, uncomment and edit lines
10 and 11 as well.
Now, create the build folder, run cmake and build the project:
$ cd ~/pynuitrack
$ mkdir build
$ cd build
$ cmake ..
$ make
Now copy the pynuitrack.so
library found in your build directory to the same
folder of your Python scripts or add this line to your ~/.bashrc
file:
export PYTHONPATH=$PYTHONPATH:"~/pynuitrack/build"