Пример #1
0
def grab_images():
    im = DS.getColourMap()
    cv2.imwrite("%s/rgb.png"%(imdir), im)   
    
    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
Пример #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]))
Пример #3
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]))
Пример #4
0
def getframe(imdir, sfx):
    im = DS.getColourMap()
    cv2.imwrite("%s/rgb%s.png" % (imdir, sfx), im)
    #im=DS.getConfidenceMap()
    #cv2.imwrite("%s/confidence%s.png"%(imdir,sfx), im)
    #im=DS.getDepthColouredMap()
    #cv2.imwrite("%s/DepthColored%s.png"%(imdir,sfx), im)
    im = DS.getDepthMap()
    cv2.imwrite("%s/depth%s.png" % (imdir, sfx), im)
    #im=DS.getGreyScaleMap()
    #cv2.imwrite("%s/gscale%s.png"%(imdir,sfx), im)
    im = DS.getSyncMap()
    np.save("%s/sync%s" % (imdir, sfx), im)
    im = DS.getUVMap()
    np.save("%s/uv%s" % (imdir, sfx), im)
    im = DS.getVertices()
    np.save("%s/vert%s" % (imdir, sfx), im)
    return "OK"
Пример #5
0
def grab_images(imdir, i):
    im = DS.getColourMap()
    cv2.imwrite("%s/rgb-%03d.png"%(imdir,i), im)       

    im = DS.getDepthMap()
    cv2.imwrite("%s/depth-%03d.png"%(imdir,i), im)   

    im = DS.getConfidenceMap()
    cv2.imwrite("%s/confidence-%03d.png"%(imdir,i), im)   
     
    im = DS.getDepthColouredMap()
    cv2.imwrite("%s/rgbd-%03d.png"%(imdir,i), im)   
  
    im = DS.getGreyScaleMap()
    cv2.imwrite("%s/gscale-%03d.png"%(imdir,i), im)   
    
    im = DS.getSyncMap()
    print im.shape
    np.save("%s/sync-%03d"%(imdir,i), im)   
    
    im = DS.getUVMap()
    np.save("%s/uv-%03d"%(imdir,i), im)   

    im = DS.getVertices()
    np.save("%s/vert-%03d"%(imdir,i), im)   
    
    #subprocess.call(['python', dir_path + '/dsgrab.py'])
    """
            {"href": "static/img/confidence.png", "name": "Confidence levels (image)"},
            {"href": "static/img/rgbd.png", "name": "Coloured depth image"},
            {"href": "static/img/gscale.png", "name": "Grey-scale image"}
    """
    return [{"href": imdir+"/rgb-%03d.png"%i, "name": "RGB image"},
            {"href": imdir+"/depth-%03d.png"%i, "name": "Depth image"},
            {"href": imdir+"/confidence-%03d.png"%i, "name": "Confidence levels (image)"},
            {"href": imdir+"/rgbd-%03d.png"%i, "name": "Coloured depth image"},
            {"href": imdir+"/gscale-%03d.png"%i, "name": "Grey-scale image"}]
Пример #6
0
    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()
    sync = sync[:,:,::-1]
    iY = Image(sync.transpose([1,0,2]))
    iY.show()
    
    
    #iV.sideBySide(iD).show()
    c+=1

Пример #7
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()
Пример #8
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()
def get_syncMap():
    sync = dsc.getSyncMap()
    sync_gray = cv2.cvtColor(sync, cv2.COLOR_BGR2GRAY)
    sync = cv2.resize(sync, (640, 480))
    sync_gray = cv2.resize(sync_gray, (640, 480))
    return sync, sync_gray