Skip to content

Commit

Permalink
flesh out README
Browse files Browse the repository at this point in the history
  • Loading branch information
rjw57 committed Mar 21, 2017
1 parent 0d095f3 commit 95c89fd
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
freenect2: Python bindings to libfreenect2
==========================================

The freenect2 module provides a Python interface to the `libfreenect2
<https://github.com/OpenKinect/libfreenect2>`_ library. The libfreenect2
library provides a library allowing depth and RGB data to be extracted from a
Kinect for Windows v2 (K4W2) device.

Although a lot of libfreenect2 functionality is exposed, simple "single grab"
usage of freenect2 should be simple. For example, here is how to grab a single
depth frame and save it to a grayscale JPEG:

.. code:: python
from PIL.ImageMath import eval as im_eval
from freenect2 import Device, FrameType
device = Device()
with device.running():
for frame_type, frame in device:
if frame_type is FrameType.Depth:
# Convert range of depth image to 0->255.
norm_im = im_eval('convert(I / 16, "L")', I=frame.to_image())
norm_im.save('depth.jpg')
break

0 comments on commit 95c89fd

Please sign in to comment.