Open GoogleCodeExporter opened 8 years ago
Found this little piece online somewhere...
#!/usr/bin/env python
from freenect import sync_get_depth as get_depth, sync_get_video as get_video
import cv
import numpy as np
def doloop():
global depth, rgb
while True:
# Get a fresh frame
(depth,_), (rgb,_) = get_depth(), get_video()
# Build a two panel color image
d3 = np.dstack((depth,depth,depth)).astype(np.uint8)
da = np.hstack((d3,rgb))
# Simple Downsample
cv.ShowImage('both',np.array(da[::2,::2,::-1]))
cv.WaitKey(5)
doloop()
"""
IPython usage:
ipython
[1]: run -i demo_freenect
#<ctrl -c=""> (to interrupt the loop)
[2]: %timeit -n100 get_depth(), get_rgb() # profile the kinect capture
"""
Original comment by john.mrd...@googlemail.com
on 18 May 2011 at 10:48
Original issue reported on code.google.com by
gnatan...@gmail.com
on 2 Mar 2011 at 4:32