#!/usr/bin/env python import freenect import matplotlib.pyplot as mp mp.ion() mp.figure(1) image_depth = mp.imshow(freenect.sync_get_depth_np()[0], interpolation="nearest", animated=True) mp.figure(2) image_rgb = mp.imshow(freenect.sync_get_rgb_np()[0], interpolation="nearest", animated=True) while 1: mp.figure(1) image_depth.set_data(freenect.sync_get_depth_np()[0]) mp.figure(2) image_rgb.set_data(freenect.sync_get_rgb_np()[0]) mp.draw()
#!/usr/bin/env python import freenect import cv import numpy as np cv.NamedWindow('Depth') cv.NamedWindow('RGB') while 1: depth, timestamp = freenect.sync_get_depth_np() rgb, timestamp = freenect.sync_get_rgb_np() cv.ShowImage('Depth', depth.astype(np.uint8)) cv.ShowImage('RGB', rgb.astype(np.uint8)) cv.WaitKey(10)
import freenect while 1: a, t0 = freenect.sync_get_depth_np() b, t1 = freenect.sync_get_rgb_np() print(t0, t1)