Skip to main content

Python wrapper over Azure Kinect SDK

Project description

pyk4a-bundle

CI codecov PyPI

pyk4a

This library is a simple and pythonic wrapper in Python 3 for the Azure-Kinect-Sensor-SDK.

Images are returned as numpy arrays and behave like python objects.

This approach incurs almost no overhead in terms of CPU, memory or other resources. It also simplifies usage. Kinect C api image buffers are directly reused and image releases are performed automatically by the python garbage collector.

Homepage: https://github.com/etiennedub/pyk4a/

Prerequisites

The Azure-Kinect-Sensor-SDK is required to build this library. To use the SDK, refer to the installation instructions here.

Install

Just install the pip package with the bundled libraries (Windows & Linux):

pip install pyk4a-bundle

Example

For a basic example displaying the first frame, you can run this code:

from pyk4a import PyK4A

# Load camera with the default config
k4a = PyK4A()
k4a.start()

# Get the next capture (blocking function)
capture = k4a.get_capture()
img_color = capture.color

# Display with pyplot
from matplotlib import pyplot as plt
plt.imshow(img_color[:, :, 2::-1]) # BGRA to RGB
plt.show()

Otherwise, a more avanced example is available in the example folder. To execute it opencv-python is required.

git clone https://github.com/etiennedub/pyk4a.git
cd pyk4a/example
python viewer.py

Documentation

No documentation is available but all functinos are properly type hinted. The code of the main class is a good place to startPyK4A.

You can also follow the various example folder scripts as reference.

Bug Reports

Submit an issue and please include as much details as possible.

Make sure to use the search function on closed issues, especially if your problem is related to installing on windows.

Module Development

  1. Install required packages: make setup

  2. Install local pyk4a version (compiles pyk4a.cpp): make build

Contribution

Feel free to send pull requests. The develop branch should be used.

Please rebuild, format, check code quality and run tests before submitting a pull request:

make build
make fmt lint
make test

Note: you need clang-format tool(v 11.0+) for formatting CPP code.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

pyk4a_bundle-1.3.0.2-cp310-cp310-win_amd64.whl (950.4 kB view details)

Uploaded CPython 3.10 Windows x86-64

pyk4a_bundle-1.3.0.2-cp310-cp310-manylinux_2_27_x86_64.whl (7.5 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.27+ x86-64

pyk4a_bundle-1.3.0.2-cp39-cp39-win_amd64.whl (950.4 kB view details)

Uploaded CPython 3.9 Windows x86-64

pyk4a_bundle-1.3.0.2-cp39-cp39-manylinux_2_27_x86_64.whl (7.5 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.27+ x86-64

pyk4a_bundle-1.3.0.2-cp38-cp38-win_amd64.whl (950.5 kB view details)

Uploaded CPython 3.8 Windows x86-64

pyk4a_bundle-1.3.0.2-cp38-cp38-manylinux_2_27_x86_64.whl (7.5 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.27+ x86-64

pyk4a_bundle-1.3.0.2-cp37-cp37m-win_amd64.whl (950.4 kB view details)

Uploaded CPython 3.7m Windows x86-64

pyk4a_bundle-1.3.0.2-cp37-cp37m-manylinux_2_27_x86_64.whl (7.5 MB view details)

Uploaded CPython 3.7m manylinux: glibc 2.27+ x86-64

pyk4a_bundle-1.3.0.2-cp36-cp36m-win_amd64.whl (950.3 kB view details)

Uploaded CPython 3.6m Windows x86-64

pyk4a_bundle-1.3.0.2-cp36-cp36m-manylinux_2_27_x86_64.whl (7.5 MB view details)

Uploaded CPython 3.6m manylinux: glibc 2.27+ x86-64

File details

Details for the file pyk4a_bundle-1.3.0.2-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: pyk4a_bundle-1.3.0.2-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 950.4 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for pyk4a_bundle-1.3.0.2-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 77f1ecc2d656e4ecd4d17d0f20df08bedfdd12b752e53468a506102fa8c948e3
MD5 25533c24f32be97e3abba4304a32fcc7
BLAKE2b-256 4296e44d5e6f0ddf6bd8317a7c4d408f9ec081a80ded588711558a31390f4d37

See more details on using hashes here.

File details

Details for the file pyk4a_bundle-1.3.0.2-cp310-cp310-manylinux_2_27_x86_64.whl.

File metadata

  • Download URL: pyk4a_bundle-1.3.0.2-cp310-cp310-manylinux_2_27_x86_64.whl
  • Upload date:
  • Size: 7.5 MB
  • Tags: CPython 3.10, manylinux: glibc 2.27+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for pyk4a_bundle-1.3.0.2-cp310-cp310-manylinux_2_27_x86_64.whl
Algorithm Hash digest
SHA256 acc3f7a0951f5335fa497e25dbcf7ea2d3bb73833836caf2e320bc066ee5c4ca
MD5 e42be765ba72b0f6f01ce00927337726
BLAKE2b-256 4a2b474bc7f2d14d6c4707596218f3794d88294717422081c1336ce6dfa541cd

See more details on using hashes here.

File details

Details for the file pyk4a_bundle-1.3.0.2-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: pyk4a_bundle-1.3.0.2-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 950.4 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for pyk4a_bundle-1.3.0.2-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 1ebd428a8fe9724c773943e1b05dc4a655331aa0ffeee9a040072cde8241607f
MD5 ff0442b31f16f240616c7a4c4363fc4f
BLAKE2b-256 31a9f4acc1b320d4fcfe56ba8206847a81dccb9df35a5ef9cd888fa08509836f

See more details on using hashes here.

File details

Details for the file pyk4a_bundle-1.3.0.2-cp39-cp39-manylinux_2_27_x86_64.whl.

File metadata

  • Download URL: pyk4a_bundle-1.3.0.2-cp39-cp39-manylinux_2_27_x86_64.whl
  • Upload date:
  • Size: 7.5 MB
  • Tags: CPython 3.9, manylinux: glibc 2.27+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for pyk4a_bundle-1.3.0.2-cp39-cp39-manylinux_2_27_x86_64.whl
Algorithm Hash digest
SHA256 bbb71cb9da8e5469856dbeab3cfc425fddef8bc387aeb9591db138934f5544b6
MD5 7933479a31a4253e7b842d40fe71e12d
BLAKE2b-256 5127a304ab6a3d1a651ccd8dd8d00ed22a6c7cd87f3e50a00313c7db35fc3cb6

See more details on using hashes here.

File details

Details for the file pyk4a_bundle-1.3.0.2-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: pyk4a_bundle-1.3.0.2-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 950.5 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for pyk4a_bundle-1.3.0.2-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 e91455297ece3993d810910976dce414d3481e39b7170a3b6066fa6acb83a4e6
MD5 bcd11ac6b446599c2598b2fb25d2df06
BLAKE2b-256 5298c15c5d05ff8622e0b5d8fc10c331ee30e04bd3314aa7343b4b7d13bb94bd

See more details on using hashes here.

File details

Details for the file pyk4a_bundle-1.3.0.2-cp38-cp38-manylinux_2_27_x86_64.whl.

File metadata

  • Download URL: pyk4a_bundle-1.3.0.2-cp38-cp38-manylinux_2_27_x86_64.whl
  • Upload date:
  • Size: 7.5 MB
  • Tags: CPython 3.8, manylinux: glibc 2.27+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for pyk4a_bundle-1.3.0.2-cp38-cp38-manylinux_2_27_x86_64.whl
Algorithm Hash digest
SHA256 cfdbad7d5b3dacfe809856229fe232a126c2129ff393c665b9140d6695eb4eff
MD5 dbd702c049483a6c743c0e11c3eb6afb
BLAKE2b-256 d3c9de07b029e5ab217b4b8578fc0ac7295547acadcebffa3151d5a14b16d22b

See more details on using hashes here.

File details

Details for the file pyk4a_bundle-1.3.0.2-cp37-cp37m-win_amd64.whl.

File metadata

  • Download URL: pyk4a_bundle-1.3.0.2-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 950.4 kB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for pyk4a_bundle-1.3.0.2-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 b4e38780d5c430fb68e6de5af97f47305aec71e6f53d74990fec5bf8844fe962
MD5 ceb483b2fbfd2792e757b6c925eb3fb6
BLAKE2b-256 d287f6e36dd3c5fb44900a49b1886d066bce27b04e4324eb24247ea56aac2fae

See more details on using hashes here.

File details

Details for the file pyk4a_bundle-1.3.0.2-cp37-cp37m-manylinux_2_27_x86_64.whl.

File metadata

  • Download URL: pyk4a_bundle-1.3.0.2-cp37-cp37m-manylinux_2_27_x86_64.whl
  • Upload date:
  • Size: 7.5 MB
  • Tags: CPython 3.7m, manylinux: glibc 2.27+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for pyk4a_bundle-1.3.0.2-cp37-cp37m-manylinux_2_27_x86_64.whl
Algorithm Hash digest
SHA256 5b17f13bc1fb658bc927ddfca0cabb91056b406af0aa3f001cf56465cbb754c4
MD5 f866b9a79acd3bb2813cdf0f08c4cc34
BLAKE2b-256 471f9db65ef6d0a3e256225a9e57de785e11b3446a1df41af56dac37274a7b13

See more details on using hashes here.

File details

Details for the file pyk4a_bundle-1.3.0.2-cp36-cp36m-win_amd64.whl.

File metadata

  • Download URL: pyk4a_bundle-1.3.0.2-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 950.3 kB
  • Tags: CPython 3.6m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for pyk4a_bundle-1.3.0.2-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 c5fca605a55fdb3533edcf6596d1c0bd0f63682cfc93ecdfe35ac2c469faba88
MD5 82b92e415d471c67646ee4a3535a02f8
BLAKE2b-256 d95c9b0e506ceb9b818f78ef2e2a0daa9f3994bde25d4f4eebd9f95e145e9df0

See more details on using hashes here.

File details

Details for the file pyk4a_bundle-1.3.0.2-cp36-cp36m-manylinux_2_27_x86_64.whl.

File metadata

  • Download URL: pyk4a_bundle-1.3.0.2-cp36-cp36m-manylinux_2_27_x86_64.whl
  • Upload date:
  • Size: 7.5 MB
  • Tags: CPython 3.6m, manylinux: glibc 2.27+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for pyk4a_bundle-1.3.0.2-cp36-cp36m-manylinux_2_27_x86_64.whl
Algorithm Hash digest
SHA256 7603488a0a2c64ad9288503a187d4d47f2e16da21a72b06fb8c0598a0d277b92
MD5 0900fd60532059af21ce945204c29669
BLAKE2b-256 6bbc10e82a50c33e8b43466a7d85972e5aca52c6fecf80aa2fe432db513d2383

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page