Software Archive
Read-only legacy content
17061 Discussions

intel realsense get depth image values

Maroun_S_
Beginner
448 Views

I am trying to put all the depth frame values into a 2D array.
My problem that the pointer p points to a null value and not to the image stored in memory. if the sample.depth != null an image should be stored in the memory(correct me if I'm wrong).
I searched for examples and found this http://mtaulty.com/CommunityServer/blogs/mike_taultys_blog/archive/2015/04/15/intel-realsense-camera-f200-a-bit-of-depth.aspx but still I have the same null problem.

     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++;
                        }
                    }
                }

0 Kudos
0 Replies
Reply