0

我已经将 Asus Xtion Pro 插入我的 PC,现在正尝试运行基本的 OpenNI2 代码以从相机中导出快照。我能够运行 OpenNI2 包附带的示例项目(例如 SimpleViewer),所以我知道它正在“工作”,但我很难超越它。

这个库的文档和操作方法似乎很稀疏,我在网上找不到一个可以做我想做的实际示例,所以如果有人有可用的代码,那就太好了以下,我将不胜感激:

  1. 设置深度和彩色图像的视频流。
  2. 定期拍摄这些流的快照(例如每 0.5 秒)
  3. 以 .png 之类的格式保存它们

谢谢

4

1 回答 1

1

This is not a hard task, try using an example from the openni2 samples. I have a tool that you can tweak to do the three tasks (sample here)

In 1) what exactly you mean with video stream? you want to compress the images into a movie? or just to show them?

If it is just to show them you can take a look to the sample I linked before.

Basicly what you have to do is:

  1. initialize the openni and the devices
  2. start the streams you need (usually depth and color)
  3. show each frame in a window (i used opencv for that) [this will do 1)]
  4. every x number of frames or time save the frames (i used opencv for this task too) [this will be 2 and 3)]
  5. create a key interface to exit properly (can be done with opencv too)

All of this is things are done in a way in the sample I gave you, but you can also ask me if you want specific details about it.

I hope this helps you

于 2014-11-02T13:44:39.200 回答