Coder Social home page Coder Social logo

py-k4a's Introduction

Alpha python library for Azure Kinect

This library is pre-alpha, weekend hack quality. It can capture single frames correctly, but it likely has lots of bugs, and there are definitely missing features.

Prereqs.

  • You have the Kinect SDK installed and k4viewer works for you.
  • You have Python3 development libraries installed. (apt-get install python3-dev)
  • You have an Azure Kinect device

Build/Install

git clone https://github.com/brendandburns/py-k4a.git
cd py-k4a
python3 setup.py build
sudo python3 setup.py install
python3 example.py

If all goes well, this will leave a file named test.jpg in your directory with a single frame capture from your device.

TODO

Add support for Audio and IMU. Fix bugs. Accept PRs.

Instructions for Window Install

This may not be the most elegant or minimal solution, but it worked for me on two different Windows 10 machines.

Prereqs.

  • You have the Kinect SDK installed and k4viewer works for you.
    • Find (corresponding on your install) following directories/files:
      • C:\Program Files\Azure Kinect SDK v1.2.0\sdk\include\k4a
      • C:\Program Files\Azure Kinect SDK v1.2.0\sdk\windows-desktop\x86\release\lib\k4a.lib
      • C:\Program Files\Azure Kinect SDK v1.2.0\sdk\windows-desktop\x86\release\bin\k4a.dll
      • C:\Program Files\Azure Kinect SDK v1.2.0\sdk\windows-desktop\x86\release\bin\k4a.pyd
      • C:\Program Files\Azure Kinect SDK v1.2.0\sdk\windows-desktop\x86\release\bin\depthengine_2_0.dll
  • You have Python 3.6 or newer development libraries installed.
    • This may be installed on your computer simply as Python.
    • Note the following directories and add them to your user Path
      • C:\Users\amy\AppData\Local\Programs\Python\Python37\include
      • C:\Users\amy\AppData\Local\Programs\Python\Python37\DLLs
      • C:\Users\amy\AppData\Local\Programs\Python\Python37\libs
  • You have a C compiler
    • e.g., VS2019 with C++ desktop development tools, C++/CLI, and most recent Windows 10 SDK installed
      • Make sure your environmental variables are set, i.e. CMAKE_C_COMPILER should point to cl.exe inside VS2019
        • e.g., C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.23.28105\bin\Hostx86\x86\cl.exe
  • Copy elements from the SDK to your Python directories and set environment and path variables
    • Add following directory (equivalent on your machine) to your user Path
      • C:\Program Files\Azure Kinect SDK v1.2.0\sdk\include
      • at this time, make sure you also have the Python paths listed above
    • Copy the k4a folder of the SDK to your Python "include" folder (see example directories above)
    • Copy the k4a.dll and k4a.pyd of the SDK to your Python DLLs folder (see example directories above)
    • Copy the k4a.lib to your Python lib folder (see example directories above)
    • Create an environmental variable LINK pointing to k4a.lib, with quotes!
      • e.g., "C:\Program Files\Azure Kinect SDK v1.2.0\sdk\windows-desktop\amd64\release\lib\k4a.lib"
  • You have an Azure Kinect device

Build/Install

git clone https://github.com/brendandburns/py-k4a.git
cd py-k4a
python setup.py build
python setup.py install
python example.py

If all goes well, this will leave a file named test.jpg in your directory with a single frame capture from your device.

TODO

Add support for Audio and IMU. Fix bugs. Accept PRs.

py-k4a's People

Contributors

brendandburns avatar amy-caali avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.