Exemplo n.º 1
0
def GetDepthMap(panoid=None, lat=None, lon=None, radius=10):
    if panoid is None:
        panoid = GSV.GetIDByLoc(lat=lat, lon=lon, radius=radius)
        if panoid is None:
            return None
    metadata = GSV.GetPanoramaMetadata(panoid=panoid)
    return CreateDepthMap(metadata)
Exemplo n.º 2
0
    '''
    depth_map = depth * 255 / 50
    depth_map[np.nonzero(np.isnan(depth_map))] = 255
    depth_map[np.nonzero(depth_map > 255)] = 255
    depth_map /= 255
    '''
    #depth_map = depth
    #'''
    depth[np.isinf(depth)] = 3000
    depth_map = np.abs(depth) + 1
    #print np.max(np.log(depth_map))
    sc = 1 / np.max(np.log(depth_map))
    depth_map = sc * np.log(depth_map)
    #depth_map = depth / np.amax(depth) * 255
    #'''
    scipy.misc.imsave('depth.png', depth_map)


def DepthToNpy(depth, store_name):
    np.save(store_name, depth)


if __name__ == '__main__':
    #CreateSphericalBuf(256, 512)
    #exit()
    #test_id = 'Bu_I2xKvp4GVH97EB4obLQ'
    test_id = 'pRANHWx41ZnTz5PsZs6JpA'
    data = GSV.GetPanoramaMetadata(panoid=test_id)
    a = CreateDepthMap(data)
    DepthToNpy(a, './G.npy')