Getting depth data of Hololens in Unity (C#)

Hi,

I am working on a project related to Hololens using Unity. I have to get the depth data from Hololens' sensors. Following the below code:

var videomediaframe = mediaframereference?.VideoMediaFrame;
var softwarebitmap = videomediaframe?.SoftwareBitmap;
if (softwarebitmap != null)
{
softwarebitmap.CopyToBuffer(bytes.AsBuffer());
}

and when I load "bytes" to a texture. It looks like this:

This image looks like a side by side image. How can I get only one side of the image (left or right)?
Now, I have to workaround by splitting this texture by some code but I think I missed something in somewhere. Because in the C++ project, I can get a single side image from the sensor perfectly.~~~~

Thank you very much!

Sincerely,

Tagged:
Sign In or Register to comment.