|
libfreenect2 0.4
Open source driver for the Kinect for Windows v2 (K4W2) sensor
|
This is the reference install path for Windows with Visual Studio. For a condensed version see the README.
If you only need a binary and are not modifying libfreenect2, see the vcpkg section at the bottom of this page — it is far less work.
Virtual machines usually do not work, because USB 3.0 isochronous transfer is delicate.
libfreenect2 talks to the sensor through libusb, which needs a compatible backend driver. Pick either UsbDk or libusbK — do not install both.
Neither interferes with the Kinect for Windows v2 SDK; you do not need the SDK to build libfreenect2, and you do not need to uninstall it first.
Follow these steps exactly:
You can switch between the SDK driver and libusbK freely with these steps.
Download the latest build (.7z) from https://github.com/libusb/libusb/releases and extract it as depends/libusb (rename the libusb-1.x.y folder to libusb).
Download the -vc64.exe installer from http://sourceforge.net/projects/libjpeg-turbo/files and extract it to c:\libjpeg-turbo64 (the installer default), to depends/libjpeg-turbo64, or anywhere pointed to by the TurboJPEG_ROOT environment variable.
Download the 64-bit build from http://www.glfw.org/download.html and extract it as depends/glfw (rename glfw-3.x.x.bin.WIN64 to glfw), or anywhere pointed to by the GLFW_ROOT environment variable.
A library-only build can skip GLFW with -DBUILD_EXAMPLES=OFF.
Intel GPU: download "Intel® SDK for OpenCL™ Applications 2016" from https://software.intel.com/en-us/intel-opencl (free registration required) and install it. Requires OpenCL 1.1 or newer.
Download and install the CUDA Toolkit. The samples package is not required — the cuda and cuda_kde pipelines depend only on Toolkit headers and libraries.
Download OpenNI 2.2.0.33 (x64) from https://github.com/structureio/OpenNI2/releases and install it to the default location under C:\Program Files. The former structure.io/openni download page is gone.
The default install path is install; change it via CMAKE_INSTALL_PREFIX.
Older toolsets also work, e.g. -G "Visual Studio 14 2015 Win64" or -G "Visual Studio 12 2013 Win64".
Or start debugging from Visual Studio.
Copy freenect2-openni2.dll and the other DLLs from install\bin (libusb-1.0.dll, glfw.dll, and so on) to C:\Program Files\OpenNI2\Tools\OpenNI2\Drivers, then run C:\Program Files\OpenNI2\Tools\NiViewer.exe.
Set LIBFREENECT2_PIPELINE to select a pipeline, for example opencl or cuda.
You can download and install libfreenect2 using the vcpkg dependency manager:
The libfreenect2 port in vcpkg is maintained by Microsoft team members and community contributors, and tracks upstream OpenKinect/libfreenect2, not this fork. If the version is out of date, please create an issue or pull request on the vcpkg repository.