# pyKinectAzure
[![PyPI](https://img.shields.io/pypi/v/pykinect-azure?color=2BAF2B)](https://pypi.org/project/pykinect-azure/)
![Azure kinect color and depth combination](https://github.com/ibaiGorordo/pyKinectAzure/blob/master/doc/images/outputImage.jpg)
Python 3 library for the Azure Kinect DK sensor-SDK.
## Similar solutions
Part of the ideas in this repository are taken from following repositories:
* [pyk4a](https://github.com/etiennedub/pyk4a): Really nice and clean Python3 wrapper for the Kinect Azure SDK.
* [Azure-Kinect-Python](https://github.com/hexops/Azure-Kinect-Python): More complete library using ctypes as in this repository, however, examples about how to use the library are missing and the library is harder to use.
The objective of this repository is to combine the strong points of both repositories by creating a easy to use library that allows the use of most of the functions of the Kinect Azure. Also, to create sample programs to showcase the uses of the library
## Prerequisites
* [Azure-Kinect-Sensor-SDK](https://github.com/microsoft/Azure-Kinect-Sensor-SDK): required to build this library.
To use the SDK, refer to the installation instructions [here](https://github.com/microsoft/Azure-Kinect-Sensor-SDK).
* **ctypes**: required to read the library.
* **numpy**: required for the matrix calculations
* **opencv-python**: Required for the image transformations and visualization.
## Installation
```commandline
pip install pykinect_azure
```
## How to use this library
* The library has **been tested in Windows 10 and Ubuntu 20.04** with the Kinect Azure SDK 1.4.0 and 1.4.1, it should also work with other operating systems.
- **Windows:** When using the pyKinectAzure class, it requires the **path to the k4a.dll module**, make sure that the path is the correct one for your Kinect Azure SDK version. By default the path (**module_path**) is set to ```C:\\Program Files\\Azure Kinect SDK v1.4.0\\sdk\\windows-desktop\\amd64\\release\\bin\\k4a.dll```.
- **Linux:** When using the pyKinectAzure class, it requires the **path to the k4a.so module**, make sure that the path is the correct one for your Kinect Azure SDK version. When using Linux set **module_path** to ```/usr/lib/x86_64-linux-gnu/libk4a.so```, please follow the [instruction](https://github.com/microsoft/Azure-Kinect-Sensor-SDK/blob/develop/docs/usage.md) from microsoft to install the right packages.
- **Nvidia Jetson:** When using the pyKinectAzure class, it requires the **path to the k4a.so module**, make sure that the path is the correct one for your Kinect Azure SDK version. When using Nvidia Jetson set **module_path** to to ```'/usr/lib/aarch64-linux-gnu/libk4a.so'```, please follow the [instruction](https://github.com/microsoft/Azure-Kinect-Sensor-SDK/blob/develop/docs/usage.md) from microsoft to install the right packages.
* The **pyKinectAzure** class is a wrapper around the **_k4a.py** module to make the library more understandable. However, the **pyKinectAzure** class still contains few methods from the Kinect Azure SDK
* The **_k4a.py** module already contains all the methods in the Kinect Azure SDK. So, for more advanced of the Kinect Azure SDK check the **_k4a.py** module.
## Examples
For an example on how to obtain and visualize the depth data from the Azure Kinect DK check the **exampleDepthImageOpenCV.py** script.
```
git clone https://github.com/ibaiGorordo/pyKinectAzure.git
cd pyKinectAzure/examples
python exampleDepthImageOpenCV.py
```
Also, there is an example to obtain and visualize the smooth depth from the Azure Kinect DK check the **exampleSmoothDepthImageOpenCV.py** script.
```
python exampleSmoothDepthImageOpenCV.py
```
> note: when you are dealing on the linux platform, please insure that the user have permission to the usb devices, or always execute under the root permission by adding `sudo` ahead.
![Azure kinect smoothed depth image comparison](https://github.com/ibaiGorordo/pyKinectAzure/blob/master/doc/images/Azure%20kinect%20smoothed%20depth%20image.png)
## Contribution
Feel free to send pull requests.
Bug reports are also appreciated. Please include as much details as possible.
## TODO:
### Wrappers for the Kinect Azure data
- [x] Create wrapper to read depth images.
- [x] Create wrapper to read Infrared images.
- [x] Create wrapper to read IMU data.
- [x] Create function to convert image buffer to image depending on the image type.
- [x] Create wrapper to transform depth image to color image.
- [x] Create wrapper to transform depth image to 3D point cloud.
- [x] Create funtion to visualize 3D point cloud.
### Create examples
- [x] Example to visualize depth images.
- [x] Example to visualize passive IR images.
- [x] Example to plot IMU data.
- [x] Example to visualize Depth as color image.
- [x] Example to overlay depth color with alpha over real image.
- [x] Example to visualize 3D point cloud
### Body tracking
- [x] Create library for the body tracking SDK similar the same way as the current library.
- [x] Combine image and skeleton data.
- [ ] Generate 3D skeleton visualization.
### Future ideas
- [ ] Run Deep Learning models on Kinect data (Openpose 3D skeleton, semantic segmentation with depth, monocular depth estimation validation)
- [ ] Track passive infrared marker for motion capture analysis
Raw data
{
"_id": null,
"home_page": "https://github.com/ibaiGorordo/pyKinectAzure",
"name": "pykinect-azure",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": null,
"author": "Ibai Gorordo",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/ee/40/402245a9d44016975a5109e83dfab73feee8919090130887c9f1c63eb87b/pykinect_azure-0.0.4.tar.gz",
"platform": null,
"description": "# pyKinectAzure\r\n[![PyPI](https://img.shields.io/pypi/v/pykinect-azure?color=2BAF2B)](https://pypi.org/project/pykinect-azure/)\r\n\r\n![Azure kinect color and depth combination](https://github.com/ibaiGorordo/pyKinectAzure/blob/master/doc/images/outputImage.jpg)\r\n\r\nPython 3 library for the Azure Kinect DK sensor-SDK.\r\n\r\n## Similar solutions\r\nPart of the ideas in this repository are taken from following repositories:\r\n* [pyk4a](https://github.com/etiennedub/pyk4a): Really nice and clean Python3 wrapper for the Kinect Azure SDK.\r\n\r\n* [Azure-Kinect-Python](https://github.com/hexops/Azure-Kinect-Python): More complete library using ctypes as in this repository, however, examples about how to use the library are missing and the library is harder to use.\r\n\r\nThe objective of this repository is to combine the strong points of both repositories by creating a easy to use library that allows the use of most of the functions of the Kinect Azure. Also, to create sample programs to showcase the uses of the library\r\n\r\n## Prerequisites\r\n* [Azure-Kinect-Sensor-SDK](https://github.com/microsoft/Azure-Kinect-Sensor-SDK): required to build this library.\r\n To use the SDK, refer to the installation instructions [here](https://github.com/microsoft/Azure-Kinect-Sensor-SDK).\r\n* **ctypes**: required to read the library.\r\n* **numpy**: required for the matrix calculations\r\n* **opencv-python**: Required for the image transformations and visualization.\r\n\r\n## Installation\r\n```commandline\r\npip install pykinect_azure\r\n```\r\n\r\n## How to use this library\r\n\r\n* The library has **been tested in Windows 10 and Ubuntu 20.04** with the Kinect Azure SDK 1.4.0 and 1.4.1, it should also work with other operating systems.\r\n\r\n - **Windows:** When using the pyKinectAzure class, it requires the **path to the k4a.dll module**, make sure that the path is the correct one for your Kinect Azure SDK version. By default the path (**module_path**) is set to ```C:\\\\Program Files\\\\Azure Kinect SDK v1.4.0\\\\sdk\\\\windows-desktop\\\\amd64\\\\release\\\\bin\\\\k4a.dll```.\r\n\r\n - **Linux:** When using the pyKinectAzure class, it requires the **path to the k4a.so module**, make sure that the path is the correct one for your Kinect Azure SDK version. When using Linux set **module_path** to ```/usr/lib/x86_64-linux-gnu/libk4a.so```, please follow the [instruction](https://github.com/microsoft/Azure-Kinect-Sensor-SDK/blob/develop/docs/usage.md) from microsoft to install the right packages.\r\n \r\n - **Nvidia Jetson:** When using the pyKinectAzure class, it requires the **path to the k4a.so module**, make sure that the path is the correct one for your Kinect Azure SDK version. When using Nvidia Jetson set **module_path** to to ```'/usr/lib/aarch64-linux-gnu/libk4a.so'```, please follow the [instruction](https://github.com/microsoft/Azure-Kinect-Sensor-SDK/blob/develop/docs/usage.md) from microsoft to install the right packages.\r\n\r\n* The **pyKinectAzure** class is a wrapper around the **_k4a.py** module to make the library more understandable. However, the **pyKinectAzure** class still contains few methods from the Kinect Azure SDK\r\n\r\n* The **_k4a.py** module already contains all the methods in the Kinect Azure SDK. So, for more advanced of the Kinect Azure SDK check the **_k4a.py** module.\r\n\r\n## Examples\r\n\r\nFor an example on how to obtain and visualize the depth data from the Azure Kinect DK check the **exampleDepthImageOpenCV.py** script.\r\n```\r\ngit clone https://github.com/ibaiGorordo/pyKinectAzure.git\r\ncd pyKinectAzure/examples\r\npython exampleDepthImageOpenCV.py\r\n```\r\n\r\nAlso, there is an example to obtain and visualize the smooth depth from the Azure Kinect DK check the **exampleSmoothDepthImageOpenCV.py** script.\r\n```\r\npython exampleSmoothDepthImageOpenCV.py\r\n```\r\n> note: when you are dealing on the linux platform, please insure that the user have permission to the usb devices, or always execute under the root permission by adding `sudo` ahead.\r\n\r\n![Azure kinect smoothed depth image comparison](https://github.com/ibaiGorordo/pyKinectAzure/blob/master/doc/images/Azure%20kinect%20smoothed%20depth%20image.png)\r\n\r\n\r\n## Contribution\r\n\r\nFeel free to send pull requests.\r\n\r\nBug reports are also appreciated. Please include as much details as possible.\r\n\r\n## TODO:\r\n\r\n### Wrappers for the Kinect Azure data\r\n- [x] Create wrapper to read depth images.\r\n- [x] Create wrapper to read Infrared images.\r\n- [x] Create wrapper to read IMU data.\r\n- [x] Create function to convert image buffer to image depending on the image type.\r\n- [x] Create wrapper to transform depth image to color image.\r\n- [x] Create wrapper to transform depth image to 3D point cloud.\r\n- [x] Create funtion to visualize 3D point cloud.\r\n\r\n### Create examples\r\n- [x] Example to visualize depth images.\r\n- [x] Example to visualize passive IR images.\r\n- [x] Example to plot IMU data.\r\n- [x] Example to visualize Depth as color image.\r\n- [x] Example to overlay depth color with alpha over real image.\r\n- [x] Example to visualize 3D point cloud\r\n\r\n### Body tracking\r\n- [x] Create library for the body tracking SDK similar the same way as the current library.\r\n- [x] Combine image and skeleton data.\r\n- [ ] Generate 3D skeleton visualization.\r\n\r\n### Future ideas\r\n- [ ] Run Deep Learning models on Kinect data (Openpose 3D skeleton, semantic segmentation with depth, monocular depth estimation validation)\r\n- [ ] Track passive infrared marker for motion capture analysis\r\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Python library to run Kinect Azure DK SDK functions",
"version": "0.0.4",
"project_urls": {
"Homepage": "https://github.com/ibaiGorordo/pyKinectAzure"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "bdd4171ae7c21f6adc061132a11bb4cba8ebd1c8a2654ded80db67b4f529c064",
"md5": "fe149ece12c0c877bded16d8443fc301",
"sha256": "a701e5daf2b291c45921838b88a7b01ddc3128eb6793faf795e7ad39a4aa7785"
},
"downloads": -1,
"filename": "pykinect_azure-0.0.4-py3-none-any.whl",
"has_sig": false,
"md5_digest": "fe149ece12c0c877bded16d8443fc301",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 35966,
"upload_time": "2024-06-22T06:34:40",
"upload_time_iso_8601": "2024-06-22T06:34:40.708073Z",
"url": "https://files.pythonhosted.org/packages/bd/d4/171ae7c21f6adc061132a11bb4cba8ebd1c8a2654ded80db67b4f529c064/pykinect_azure-0.0.4-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "ee40402245a9d44016975a5109e83dfab73feee8919090130887c9f1c63eb87b",
"md5": "2dc228b108c5ae28b58068141c528250",
"sha256": "15f72bfd76f63024247d22199389e96dbc8b6f5c7ae4d0672b6628969189f57a"
},
"downloads": -1,
"filename": "pykinect_azure-0.0.4.tar.gz",
"has_sig": false,
"md5_digest": "2dc228b108c5ae28b58068141c528250",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 29906,
"upload_time": "2024-06-22T06:34:42",
"upload_time_iso_8601": "2024-06-22T06:34:42.693790Z",
"url": "https://files.pythonhosted.org/packages/ee/40/402245a9d44016975a5109e83dfab73feee8919090130887c9f1c63eb87b/pykinect_azure-0.0.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-06-22 06:34:42",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "ibaiGorordo",
"github_project": "pyKinectAzure",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [],
"lcname": "pykinect-azure"
}