Extracting data in C#

Hi everyone,

I’m trying to integrate an Astra mini camera to an existing system which runs on Windows and is coded in C#. I found a pretty cool OpenNI2 C# Wrapper (https://falahati.net/my-blog/92-niwrapper-openni-2-net-wrapper), but now I’m stuck when I try extracting data from an oni file I recorded earlier. Ultimatly, what I need is the data pointed to by VideoFramRef.getData() (more precisely, I want the depth of each pixel).

If I understand correctly, in C++ there’s a type PixelDepth that one can use to cast the void pointer you get when you call getData() on a VideoFrameRef. The problem is that PixelDepth doesn’t exist in the wrapper I use and so I am not sure how to proceed.

What I would like to do is to create a PixelDepth class (or some other structure) which would hold the data of a pixel, but in order to do so, I need to know precisely how is the data array structured.

Am I getting this right? If so, could someone either point me toward a good description of the data array (what type it includes, in which order, etc.) or, if there’s a simpler way, share any suggestion on how to proceed? If not, could you tell me what I missed?

Thanks a lot for the help,