0

I've got the Asus Xtion Pro plugged into my PC, and am now trying to run basic OpenNI2 code to export snaphots from the cameras. I am able to run the sample projects that comes with the OpenNI2 package (e.g. SimpleViewer), so I know that it is 'working', but I am trouble getting anywhere past that.

The documentation and how-to side of things for this library seems quite sparse, and I can't find an actual example online that does what I'd like to do, so it would be great if anyone who has the code available that does the following, I'd be grateful:

  1. set up a video stream of depth and colour images.
  2. takes snapshots of these streams at regular intervals (e.g. every 0.5 seconds)
  3. saves these in a format like .png

Thanks

user1488804
  • 840
  • 1
  • 13
  • 27

1 Answers1

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

api55
  • 11,070
  • 4
  • 41
  • 57