00001
00002 import freenect
00003 import cv
00004
00005 cv.NamedWindow('RGB')
00006
00007
00008 def display(dev, data, timestamp):
00009 image = cv.CreateImageHeader((data.shape[1], data.shape[0]),
00010 cv.IPL_DEPTH_8U,
00011 3)
00012
00013 cv.SetData(image, data[:, :, ::-1].tostring(),
00014 data.dtype.itemsize * 3 * data.shape[1])
00015 cv.ShowImage('RGB', image)
00016 cv.WaitKey(5)
00017 freenect.runloop(rgb=lambda *x: display(*freenect.rgb_cb_np(*x)))