Skip to main content

Python wrapper over Azure Kinect SDK

Project description

pyk4a-bundle

CI codecov

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-cp310-cp310-win_amd64.whl (950.1 kB view details)

Uploaded CPython 3.10 Windows x86-64

pyk4a_bundle-1.3.0-cp310-cp310-manylinux_2_27_x86_64.whl (13.5 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.27+ x86-64

pyk4a_bundle-1.3.0-cp39-cp39-win_amd64.whl (950.1 kB view details)

Uploaded CPython 3.9 Windows x86-64

pyk4a_bundle-1.3.0-cp39-cp39-manylinux_2_27_x86_64.whl (13.5 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.27+ x86-64

pyk4a_bundle-1.3.0-cp38-cp38-win_amd64.whl (950.2 kB view details)

Uploaded CPython 3.8 Windows x86-64

pyk4a_bundle-1.3.0-cp38-cp38-manylinux_2_27_x86_64.whl (13.5 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.27+ x86-64

pyk4a_bundle-1.3.0-cp37-cp37m-win_amd64.whl (950.1 kB view details)

Uploaded CPython 3.7m Windows x86-64

pyk4a_bundle-1.3.0-cp37-cp37m-manylinux_2_27_x86_64.whl (13.5 MB view details)

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

pyk4a_bundle-1.3.0-cp36-cp36m-win_amd64.whl (950.1 kB view details)

Uploaded CPython 3.6m Windows x86-64

pyk4a_bundle-1.3.0-cp36-cp36m-manylinux_2_27_x86_64.whl (13.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-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: pyk4a_bundle-1.3.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 950.1 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.10

File hashes

Hashes for pyk4a_bundle-1.3.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 323b37755c9faf0aa754f3b89acd8495566dae0503dc72f1823594c2df5f9fbc
MD5 1e6d40468ad7c1119ae9c323c449ebcc
BLAKE2b-256 92b64b29f5fa80a72fac2446692c959dd1afdc421c6f7f4bcb1c96db44c81cae

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyk4a_bundle-1.3.0-cp310-cp310-manylinux_2_27_x86_64.whl
  • Upload date:
  • Size: 13.5 MB
  • Tags: CPython 3.10, manylinux: glibc 2.27+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.10

File hashes

Hashes for pyk4a_bundle-1.3.0-cp310-cp310-manylinux_2_27_x86_64.whl
Algorithm Hash digest
SHA256 103616a4c2ee444c6821f0236e38a3c4961015cdbfe96632f79477332e781a41
MD5 fda91fa2ed906f06de4efc44d7805fc2
BLAKE2b-256 1074c7340689438f2ce6ffd0c70df071c202b2991c16b2aa857bf74131da81cf

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyk4a_bundle-1.3.0-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 950.1 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.10

File hashes

Hashes for pyk4a_bundle-1.3.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 3c1e971c5e5c495335c309b21d410c46827e74e02b13a412d9a73962bb87ed77
MD5 075a2f2879f0fdff6a2b821f1108656b
BLAKE2b-256 0e429b6442be9a6d7e2631a3a1c84672048fed7fc907f4aa6ed5101a6295ac48

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyk4a_bundle-1.3.0-cp39-cp39-manylinux_2_27_x86_64.whl
  • Upload date:
  • Size: 13.5 MB
  • Tags: CPython 3.9, manylinux: glibc 2.27+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.10

File hashes

Hashes for pyk4a_bundle-1.3.0-cp39-cp39-manylinux_2_27_x86_64.whl
Algorithm Hash digest
SHA256 6aa49b4db7ba5e22058ce2b974d64bfed05d9a2ae63ed7c4c75579599a26d63a
MD5 8332650a01c0a714c8cb05071787edf4
BLAKE2b-256 c4c8435522ac387b78d6c70717f822d17402207192fd0cbda9cdff31ac2a5be8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyk4a_bundle-1.3.0-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 950.2 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.10

File hashes

Hashes for pyk4a_bundle-1.3.0-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 ab4c85d809932e3585c615d5786d36f139eedbfa48ff7042af5dc937523a697f
MD5 4297c653e829ce4201104d09717eac9e
BLAKE2b-256 85c3bc0715d3f0c319db30792ef41920f050586f2c1c11ef034181e698087742

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyk4a_bundle-1.3.0-cp38-cp38-manylinux_2_27_x86_64.whl
  • Upload date:
  • Size: 13.5 MB
  • Tags: CPython 3.8, manylinux: glibc 2.27+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.10

File hashes

Hashes for pyk4a_bundle-1.3.0-cp38-cp38-manylinux_2_27_x86_64.whl
Algorithm Hash digest
SHA256 fb07513eebfbe799120547a5253eb01dcdabe1e55982df90715f9e76edffa598
MD5 49d97313fb5c12cb1b87ab52aaac46ae
BLAKE2b-256 4e2c6890ed550790672e3cfc6d557eedb38d3907a1639be2ad29f1e489579e88

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyk4a_bundle-1.3.0-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 950.1 kB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.10

File hashes

Hashes for pyk4a_bundle-1.3.0-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 e5f1a1cda1f5ac4d4cd31c0f04e15af58e638d2c7491b63d2bfc490c02fc1ea7
MD5 b11c4e5954a948652b34816ebb2fe9fa
BLAKE2b-256 ed0874b5aec3503fd1fb71edae94519835597704371baec33aeacd75d5ce310c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyk4a_bundle-1.3.0-cp37-cp37m-manylinux_2_27_x86_64.whl
  • Upload date:
  • Size: 13.5 MB
  • Tags: CPython 3.7m, manylinux: glibc 2.27+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.10

File hashes

Hashes for pyk4a_bundle-1.3.0-cp37-cp37m-manylinux_2_27_x86_64.whl
Algorithm Hash digest
SHA256 2ab705d95efa3135e339734deab44f489775ce841e98329cec422e5f46d12726
MD5 e04ff963479693519e20627f070844a6
BLAKE2b-256 b4e2a560bcea486178b6f4ecf6652a5eb79611f842baf92a2327afb674009d7e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyk4a_bundle-1.3.0-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 950.1 kB
  • Tags: CPython 3.6m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.10

File hashes

Hashes for pyk4a_bundle-1.3.0-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 6e3c8186077b51ddb61e7f5ee4d4dc8c5a3bc84400e08e85798d963b52738694
MD5 b6453906c5bd33337b4d7976d4b014e2
BLAKE2b-256 ec4caed22f3a9b2b70791b97e1cff306dd44c917fa9accad3e0cae4da4144e80

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyk4a_bundle-1.3.0-cp36-cp36m-manylinux_2_27_x86_64.whl
  • Upload date:
  • Size: 13.5 MB
  • Tags: CPython 3.6m, manylinux: glibc 2.27+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.10

File hashes

Hashes for pyk4a_bundle-1.3.0-cp36-cp36m-manylinux_2_27_x86_64.whl
Algorithm Hash digest
SHA256 3dd64288bfc2f0c832da297c76a9e8e310a32ca38819403aa9e670ca8e38b76b
MD5 a77fb626b50a98cf12f348a31a8176d3
BLAKE2b-256 377d961c46d4b1f947293622b36e8193ed6573ce2e551f78c20c4e34c52d2c9b

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