Advertisement
Guest User

Untitled

a guest
Jun 29th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.50 KB | None | 0 0
  1. from freenect import *
  2. import opencv.cv as cv
  3. import opencv.highgui as highgui
  4. from opencv import *
  5. import numpy as np
  6.  
  7. highgui.cvNamedWindow('Depth')
  8.  
  9.  
  10. def display(dev, data, timestamp):
  11.     data -= np.min(data.ravel())
  12.     data *= 65536 / np.max(data.ravel())
  13.     size = cv.CvSize()
  14.     size.height = data.shape[0]
  15.     size.width = data.shape[1]
  16.     image = cv.CvImage(size,IPL_DEPTH_16U,1)
  17.     image.show('Depth')
  18.     highgui.cvWaitKey(5)
  19. runloop(depth_cb_factory(display), lambda *x: None)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement