#!/usr/bin/env python
import freenect
import cv,cv2
import frame_convert

cv.NamedWindow('Depth')
cv.NamedWindow('RGB')
keep_running = True

def display_depth(dev, data, timestamp):
	global keep_running
	cv.ShowImage('Depth', frame_convert.pretty_depth_cv(data))
	if cv.WaitKey(10) == 27:
		keep_running = False

def display_rgb(dev, data, timestamp):
	global keep_running
	img = frame_convert.video_cv(data)
	cv.ShowImage('RGB', img)
	cv2.imwrite('test.png', data)
	if cv.WaitKey(1000) == 27:
		keep_running = False

def body(*args):
	if not keep_running:
		raise freenect.Kill
		print('Press ESC in window to stop')

freenect.runloop(depth=display_depth, video=display_rgb, body=body)

e9f67b1b99522fac8731830bd6d4413947b2f180
<mask token>


def display_depth(dev, data, timestamp):
    global keep_running
    cv.ShowImage('Depth', frame_convert.pretty_depth_cv(data))
    if cv.WaitKey(10) == 27:
        keep_running = False


<mask token>


def body(*args):
    if not keep_running:
        raise freenect.Kill
        print('Press ESC in window to stop')


<mask token>

<mask token>


def display_depth(dev, data, timestamp):
    global keep_running
    cv.ShowImage('Depth', frame_convert.pretty_depth_cv(data))
    if cv.WaitKey(10) == 27:
        keep_running = False


def display_rgb(dev, data, timestamp):
    global keep_running
    img = frame_convert.video_cv(data)
    cv.ShowImage('RGB', img)
    cv2.imwrite('test.png', data)
    if cv.WaitKey(1000) == 27:
        keep_running = False


def body(*args):
    if not keep_running:
        raise freenect.Kill
        print('Press ESC in window to stop')


<mask token>

<mask token>
cv.NamedWindow('Depth')
cv.NamedWindow('RGB')
<mask token>


def display_depth(dev, data, timestamp):
    global keep_running
    cv.ShowImage('Depth', frame_convert.pretty_depth_cv(data))
    if cv.WaitKey(10) == 27:
        keep_running = False


def display_rgb(dev, data, timestamp):
    global keep_running
    img = frame_convert.video_cv(data)
    cv.ShowImage('RGB', img)
    cv2.imwrite('test.png', data)
    if cv.WaitKey(1000) == 27:
        keep_running = False


def body(*args):
    if not keep_running:
        raise freenect.Kill
        print('Press ESC in window to stop')


freenect.runloop(depth=display_depth, video=display_rgb, body=body)

import freenect
import cv, cv2
import frame_convert
cv.NamedWindow('Depth')
cv.NamedWindow('RGB')
keep_running = True


def display_depth(dev, data, timestamp):
    global keep_running
    cv.ShowImage('Depth', frame_convert.pretty_depth_cv(data))
    if cv.WaitKey(10) == 27:
        keep_running = False


def display_rgb(dev, data, timestamp):
    global keep_running
    img = frame_convert.video_cv(data)
    cv.ShowImage('RGB', img)
    cv2.imwrite('test.png', data)
    if cv.WaitKey(1000) == 27:
        keep_running = False


def body(*args):
    if not keep_running:
        raise freenect.Kill
        print('Press ESC in window to stop')


freenect.runloop(depth=display_depth, video=display_rgb, body=body)

#!/usr/bin/env python
import freenect
import cv,cv2
import frame_convert

cv.NamedWindow('Depth')
cv.NamedWindow('RGB')
keep_running = True

def display_depth(dev, data, timestamp):
	global keep_running
	cv.ShowImage('Depth', frame_convert.pretty_depth_cv(data))
	if cv.WaitKey(10) == 27:
		keep_running = False

def display_rgb(dev, data, timestamp):
	global keep_running
	img = frame_convert.video_cv(data)
	cv.ShowImage('RGB', img)
	cv2.imwrite('test.png', data)
	if cv.WaitKey(1000) == 27:
		keep_running = False

def body(*args):
	if not keep_running:
		raise freenect.Kill
		print('Press ESC in window to stop')

freenect.runloop(depth=display_depth, video=display_rgb, body=body)
