Exemplo n.º 1
0
    def getConvolvedImage(self, kern, rep, bias):
        ''' Return a simple cv compatiable 8bit greyscaled image that has had 
        the specified kernel applied rep times with bias supplied'''

        conv = ds.convolveColourMap(kern, rep, bias)
        iE = Image(conv.transpose())
        return iE.invert()
Exemplo n.º 2
0
    def getSync(self):
        ''' Return a simplecv compatiable synced map with dimensions of the 
        depth map and colours from the colour map. Indexes here match indexes 
        in the vertex map '''

        sync = ds.getSyncMap()
        sync = sync[:,:,::-1]
        return Image(sync.transpose([1,0,2]))
Exemplo n.º 3
0
    def getDepth(self):
        ''' Return a simple cv compatiable 8bit depth image '''

        depth = ds.getDepthMap()
        np.clip(depth, 0, 2**10 - 1, depth)
        depth >>=2
        depth = depth.astype(np.uint8)
        iD = Image(depth.transpose())
        return iD.invert()
Exemplo n.º 4
0
    def getConvolvedDepth(self, kern, rep, bias):
        ''' Return a simple cv compatiable 8bit depth map that has had 
        the specified kernel applied rep times '''

        conv = ds.convolveDepthMap(kern, rep, bias)
        np.clip(conv, 0, 2**10 - 1, conv)
        conv >>=2
        conv = conv.astype(np.uint8)
        iE = Image(conv.transpose())
        return iE.invert()
Exemplo n.º 5
0
    def getDepthColoured(self):
        ''' Return a simple cv compatiable 8bit colour image ''' 

        depthc = ds.getDepthColouredMap()
        #depthc = depthc[:,:,::-1]
        return Image(depthc.transpose([1,0,2]))
Exemplo n.º 6
0
    def getGreyScale(self):
        ''' Return a simple cv compatiable 8bit colour image ''' 

        grey = ds.getGreyScaleMap()
        return Image(grey.transpose())
Exemplo n.º 7
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()
Exemplo n.º 8
0
    def getImage(self):
        ''' Return a simple cv compatiable 8bit colour image ''' 

        image = ds.getColourMap()
        image = image[:,:,::-1]
        return Image(image.transpose([1,0,2]))
Exemplo n.º 9
0
    def getUV(self):
        ''' Return a uv map, the map represents a conversion from depth 
        indicies to scaled colour indicies from 0 - 1 '''

        return ds.getUVMap()
Exemplo n.º 10
0
#!/bin/python2

import DepthSense as ds
import numpy as np
from SimpleCV import *
c = 0
ds.initDepthSense()
while True:
    depth = ds.getDepthMap()
    np.clip(depth, 0, 2**10 - 1, depth)
    depth >>=2
    depth = depth.astype(np.uint8)
    iD = Image(depth.transpose())
    #iD.show()


    vertex = ds.getVertices()
    iV = Image(vertex.transpose([1,0,2]))
    #iV.show()


    image = ds.getColourMap()
    image = image[:,:,::-1]
    iS = Image(image.transpose([1,0,2]))
    #iS.show()

    #print ds.getAcceleration()

    uv = ds.getUVMap()

    sync = ds.getSyncMap()
Exemplo n.º 11
0
    def getConvolvedDepthFull(self, kern, rep, bias):
        ''' Return a pure numpy array of the convolved in the depthmap ''' 

        iE = ds.convolveDepthMap(kern, rep, bias)
        return iE
Exemplo n.º 12
0
 def getDepthFull(self):
     ''' Return the pure 16bit depth map as a numpy array '''
      
     iD = ds.getDepthMap()
     return iD
Exemplo n.º 13
0
    def saveMap(self, name, file_name):
        ''' Save the specified map to file file_name '''

        ds.saveMap(name, file_name);
        return
Exemplo n.º 14
0
    def getSyncFull(self):
        ''' Return a colour synced depth map, like above indicies here work on
        both the depth map and vertex map '''

        return ds.getSyncMap()
Exemplo n.º 15
0
    def getAcceleration(self):
        ''' Return the current acceleration of the device (x,y,z) measured in 
        g force as a numpy array '''

        return ds.getAcceleration()
Exemplo n.º 16
0
    def getVertex(self):
        ''' Return a vertex map for points in the depth map as a numpy array'''

        return ds.getVertices()
Exemplo n.º 17
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()
Exemplo n.º 18
0
    def getVertexFP(self):
        ''' Return a floating point vertex map for points in the depth map as 
        a numpy array'''

        return ds.getVerticesFP()
Exemplo n.º 19
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()
    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()
Exemplo n.º 20
0
    def getDepthFull(self):
        """ Return the pure 16bit depth map as a numpy array """

        return ds.getDepthMap()