Requirements
Follow my previous blog posting, https://blog.keithkim.com/2019/03/kinect-2-and-windows-10-face.html to:
- Connect XBox One Kinect2 to Windows
- Install SDK
Install PyKinect2
Install from the source, then you'd avoid some errors. If installed by using pip, then see the issue page:
- Source - this page shows how to install using PIP or manually.
- Issue Page, https://github.com/Kinect/PyKinect2/issues/37
- optional, but best to use with Anaconda, Python 3.7
- Numpy, comtypes, PyGame
Example Code
From the source, there are two examples:
- PyKinectBodyGame.py - shows detecting body motion
- PyKinectInfraRed.py - shows IR camera image
Below photo shows stick figure over my body; where my arms/hands are. I had to carry my keyboard to take the screenshot so it's not showing the stick figure too well, but it actually works pretty good.
I had to crop the image and cover my face for privacy.
Sum Up
I already have Kinect2 to play around, but many folks already implemented similar motion detection/capture just using a webcam with OpenCV python.
For motion capture alone, Kinect doesn't give much benefit over using a cheap webcam with OpenCV. The real benefit is the depth sensor. This also now can be done with with dual webcam, or dedicated devices that can also be used with Raspberry Pi. They are smaller too.
XBox Kinect2 is not for close range motion detection/capture device. For close range, it's better to use other method -- e.g. older Kinect for PC, or other devices.
If you're into stereo vision based depth sensing, don't get Kinect; rather get two webcams or better yet, get StereoPi, Mynteye, or two webcam based device. See below links.
Stereo Vision Cameras
- https://stereopi.com/
- https://www.raspberrypi.org/blog/real-time-depth-perception-with-the-compute-module/
- https://www.mynteye.com
- https://www.arducam.com/product/b0195-synchronized-stereo-camera-hat-raspberry-pi/
- https://www.uctronics.com/index.php/camera-modules/usb-uvc-camera-module/arducam-stereo-usb-camera-synchronized-visible-light-and-infrared-camera-2mp-1080p-day-and-night-mini-uvc-usb2-0-webcam-board-for-face-recognition-and-biological-detection.html
Other Resources
I didn't install/set up below as it appears to be a lot of effort is needed, but comes with more functionalities.
- Kinect: How to install and use OpenNI on Windows – Part 1 & Part 2
- https://yannickloriot.com/2011/03/kinect-how-to-install-and-use-openni-on-windows-part-1/
- https://yannickloriot.com/category/tutorial/kinect/
- OpenKinect for Kinect2,
- OpenNI2 Download, https://structure.io/openni
- OpenNI & Nite (older version) http://fivedots.coe.psu.ac.th/~ad/kinect/installation.html
- Python OpenNI wrapper, https://pypi.org/project/openni/