#!/bin/python2

import DepthSense as ds
import numpy as np
import copy as copy
from SimpleCV import *
import sys
from time import sleep

ds.initDepthSense()
#disp = Display(flags = pg.FULLSCREEN)
disp = Display()
points = []
squares = []

# Main loop closes only on keyboard kill signal 
while True: 
 
    # Get depth and colour images from the kinect
    image = ds.getColourMap()
    image = image[:,:,::-1]
    img = Image(image.transpose([1,0,2]))
 
    depth = ds.getDepthMap()
    np.clip(depth, 0, 2**10 - 1, depth)
    depth >>=2
    depth = depth.astype(np.uint8).transpose()
    depth = Image(depth)
    depth = depth.invert()
 
    #vertex = ds.getVertices()
Exemple #2
0
    im = DS.getDepthMap()
    cv2.imwrite("%s/depth.png"%(imdir), im)   

    im = DS.getConfidenceMap()
    cv2.imwrite("%s/confidence.png"%(imdir), im)   
    
    im = DS.getDepthColouredMap()
    cv2.imwrite("%s/rgbd.png"%(imdir), im)   
    
    im = DS.getGreyScaleMap()
    cv2.imwrite("%s/gscale.png"%(imdir), im)   
    
    im = DS.getSyncMap()
    np.save("%s/sync"%(imdir), im)   
    
    im = DS.getUVMap()
    np.save("%s/uv"%(imdir), im)   
    
    im = DS.getVertices()
    np.save("%s/vert"%(imdir), im)   
    return

imdir = "static/img"

ds = DS.initDepthSense()
time.sleep(4)
grab_images()
time.sleep(1)
grab_images()

Exemple #3
0
 def __init__(self, dim=[320,240]):
     # TODO: Pass in dim to init (currently defaults to 640, 480 for camera)
     # TODO: Allow for enabling camera/depth/accel independantly
     ''' The maps returned by the ds mod are not transposed, the maps
     used ''' 
     ds.initDepthSense()
Exemple #4
0
#!/bin/python2

import DepthSense as ds
import numpy as np
import copy as copy
from SimpleCV import *
import sys
from time import sleep

ds.initDepthSense()
#disp = Display(flags = pg.FULLSCREEN)
#disp = Display()
points = []
squares = []

# Main loop closes only on keyboard kill signal
while True:

    # Get depth and colour images from the kinect
    #image = ds.getColourMap()
    #image = image[:,:,::-1]
    #img = Image(image.transpose([1,0,2]))

    depth = ds.getDepthMap()
    deepDepth = depth.transpose()  # later proccessing
    np.clip(depth, 0, 2**10 - 1, depth)
    depth >>= 2
    depth = depth.astype(np.uint8).transpose()
    depth = Image(depth)
    depth = depth.invert()
Exemple #5
0
 def __init__(self, dim=[320, 240]):
     # TODO: Pass in dim to init (currently defaults to 640, 480 for camera)
     # TODO: Allow for enabling camera/depth/accel independantly
     ''' The maps returned by the ds mod are not transposed, the maps
     used '''
     ds.initDepthSense()