Metadata-Version: 2.1
Name: pyk4a-bundle
Version: 1.3.0.2
Summary: Python wrapper over Azure Kinect SDK
Home-page: https://github.com/cansik/pyk4a
License: UNKNOWN
Platform: UNKNOWN
Classifier: Operating System :: OS Independent
Classifier: License :: OSI Approved :: MIT License
Classifier: Development Status :: 4 - Beta
Classifier: Topic :: Multimedia :: Video :: Capture
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: C
Description-Content-Type: text/markdown
Requires-Dist: numpy
Requires-Dist: python-version (>="3.4")

# pyk4a-bundle

![CI](https://github.com/etiennedub/pyk4a/workflows/CI/badge.svg)
[![codecov](https://codecov.io/gh/etiennedub/pyk4a/branch/master/graph/badge.svg)](https://codecov.io/gh/etiennedub/pyk4a) [![PyPI](https://img.shields.io/pypi/v/pyk4a-bundle?style=plastic)](https://pypi.org/project/pyk4a-bundle/)

![pyk4a](https://github.com/etiennedub/pyk4a/raw/master/figs/pyk4a_logo.png) 


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](https://github.com/microsoft/Azure-Kinect-Sensor-SDK) is required to build this library.
To use the SDK, refer to the installation instructions [here](https://github.com/microsoft/Azure-Kinect-Sensor-SDK).


## Install

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

```bash
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](https://github.com/etiennedub/pyk4a/tree/master/example) folder.
To execute it [opencv-python](https://github.com/skvark/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](https://docs.python.org/3/library/typing.html).
The code of the main class is a good place to start[PyK4A](https://github.com/etiennedub/pyk4a/blob/master/pyk4a/pyk4a.py).

You can also follow the various [example folder](example) 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](https://github.com/etiennedub/pyk4a/issues?q=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:
```shell script
make build
make fmt lint
make test
```

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


