#!/usr/bin/python import time, webbrowser from operator import add from SimpleCV import Color, ColorCurve, Kinect, Image, pg, np from SimpleCV.Display import Display d = Display() #create video streams cam = Kinect() #initialize the camera compositeframe = Image((640, 480)) #populate the compositeframe offtime = 5.0 laststroke = time.time() while not d.isDone(): img = cam.getImage() imgscene = img.copy() depth = cam.getDepth() mindepth = np.min(depth.getNumpy()) if mindepth < 180: depthbin = depth.binarize(np.min(depth.getNumpy()) + np.std(depth.getNumpy()) / 4).erode(3) #take the front 1/4 stdev of the depth map img = img.crop(0,25, 605, 455).scale(640,480)
from SimpleCV import Kinect # Initialize the Kinect kin = Kinect() # Initialize the display display = kin.getDepth().show() # Run in a continuous loop forever while (True): # Snaps a picture, and returns the grayscale depth map depth = kin.getDepth() # Show the actual image on the screen depth.save(display)