Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from freenect import *
- import opencv.cv as cv
- import opencv.highgui as highgui
- from opencv import *
- import numpy as np
- highgui.cvNamedWindow('Depth')
- def display(dev, data, timestamp):
- data -= np.min(data.ravel())
- data *= 65536 / np.max(data.ravel())
- size = cv.CvSize()
- size.height = data.shape[0]
- size.width = data.shape[1]
- image = cv.CvImage(size,IPL_DEPTH_16U,1)
- image.show('Depth')
- highgui.cvWaitKey(5)
- runloop(depth_cb_factory(display), lambda *x: None)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement