demo_cv_async.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 import freenect
3 import cv
4 import frame_convert
5 
6 cv.NamedWindow('Depth')
7 cv.NamedWindow('RGB')
8 keep_running = True
9 
10 
11 def display_depth(dev, data, timestamp):
12  global keep_running
13  cv.ShowImage('Depth', frame_convert.pretty_depth_cv(data))
14  if cv.WaitKey(10) == 27:
15  keep_running = False
16 
17 
18 def display_rgb(dev, data, timestamp):
19  global keep_running
20  cv.ShowImage('RGB', frame_convert.video_cv(data))
21  if cv.WaitKey(10) == 27:
22  keep_running = False
23 
24 
25 def body(*args):
26  if not keep_running:
27  raise freenect.Kill
28 
29 
30 print('Press ESC in window to stop')
31 freenect.runloop(depth=display_depth,
32  video=display_rgb,
33  body=body)
def display_rgb(dev, data, timestamp)
def display_depth(dev, data, timestamp)
def body(args)
def pretty_depth_cv(depth)
def video_cv(video)


libfreenect
Author(s): Hector Martin, Josh Blake, Kyle Machulis, OpenKinect community
autogenerated on Thu Jun 6 2019 19:25:38