00001
00002 import freenect
00003 import matplotlib.pyplot as mp
00004
00005 mp.ion()
00006 image = None
00007
00008
00009 def display(dev, data, timestamp):
00010 global image
00011 if image:
00012 image.set_data(data)
00013 else:
00014 image = mp.imshow(data, interpolation='nearest', animated=True)
00015 mp.draw()
00016
00017 if __name__ == '__main__':
00018 freenect.runloop(depth=lambda *x: display(*freenect.depth_cb_np(*x)))