NtKinectDLL and NtKinect_py: Tutorial:

Using various functions of Kinect V2 on Python (Fundamental Settings)


2017.11.08: created by
Japanese English
To Table of Contents

Prerequisite necessary items

It is assumed that the following softwares are installed. If the installation path is different, please read as appropriate.


Use NtKinectDLL in Python

[Notice] If you use the official SDK published by Microsoft, you can use Kinect V2 in Python, and i think it is more common. Here, from the technical point of view, I will describe the method of creating a DLL that uses Kinect V2 by myself and using it in Python.

  1. [Important] Compile the latest NtKinectDLL and create NtKinectDLL.dll. How to compile it is explained here. If the library path required for execution is the same as my compilation environment, you can also download the binary.
  2. For details on how to use DLL with Python, we recommend that you read the official manual.
  3. Create a working directory.
  4. Place NtKinectDLL.dll under the working directory.
  5. Copy all Kinect V2 face recognition libraries under the working directory.
  6. Copy all the files under the folder "$(KINECTSDK20_DIR)Redist\Face\x64\".

    [NOTICE] $(KINECTSDK20_DIR) is set to "C:\Program Files\Microsoft SDKs\Kinect\v2.0_1409\" in my environment. Please change according to your own environment.

  7. Copy all Kinect V2 gesture recognition libraries under the working directory.
  8. copy all the files under the "$(KINECTSDK20_DIR)Redist\VGB\x64\".

    [NOTICE] $(KINECTSDK20_DIR) is set to "C:\Program Files\Microsoft SDKs\Kinect\v2.0_1409\" in my environment. Please change according to your own environment.

  9. [Important]Put NtKinect.py under the working directory.
  10. Download the latest NtKinect.py and place the working directory.

  11. Execute "python" in the shell such as "Command Prompt" or "PowerShell".
  12. When you type as the following , the RGB image acquired by Kinect V2 is displayed in a separate window, and the recognition status of the skeleton and face is displayed in that window.
  13. import NtKinect
    
    def sample(n):
      for x in range(n):
        NtKinect.setRGB()
        NtKinect.setSkeleton()
        NtKinect.setFace()
        NtKinect.imshowBlack()
    
    sample(500)
    






  14. The files described in this topic is here NtKinect_py.zip.
  15. Since the above zip file may not include the latest "NtKinectDLL.dll" and "NtKinect.py", Download the latest version from here and replace old one with it.



http://nw.tsuda.ac.jp/