intel realsense获取深度图像值

时间:2015-08-11 09:35:33

标签: c# realsense

我试图将帧的所有信息深度值放入2D数组中。 我的问题是指针p指向空值而不是存储在内存中的数据。如果sample.depth!= null,则应将图像存储在内存中(如果我错了,请更正我)。 我搜索了一些示例并找到了这个example,但我仍然遇到了同样的null问题。

 if (sample.depth != null)
        {
            for (int y = 0; y < sample.depth.info.height; y++)
            {
                unsafe
                {
                    UInt16* p = (UInt16*)dataDepth.planes[0].ToPointer();
                    for (int x = 0; x < sample.depth.info.width; x++)
                    {
                        picDepth[y, x] = p[0];
                        p++;
                    }
                }
            }

1 个答案:

答案 0 :(得分:0)

你正在调用带有dataDepth的sample.depth.AcquireAccess,对吗?