我在 python 中使用 PyOpenni 从 Asus Xtion Live Pro 读取数据传感器。如果我尝试读取深度数据,一切都会像魅力一样:
depth = DepthGenerator()
depth.create(context)
depth.set_resolution_preset(DefResolution.RES_VGA)
depth.fps = 30
context.start_generating_all()
while True:
context.wait_one_update_all(depth)
print depth.get_raw_depth_map_8()
即使在每秒 20-30 帧的情况下也可以正常工作,但问题是当我尝试使用相同的方法获取 RGBImage 时:
image = ImageGenerator()
image.create(context)
image.set_resolution_preset(DefResolution.RES_VGA)
image.fps = 30
context.start_generating_all()
while True:
context.wait_one_update_all(image)
print image.get_raw_image_map)
程序在指令中等待了很多停止
context.wait_one_update_all(image)
所以我每秒只能或多或少地获得 2-3 帧。
有谁知道为什么?