Items with no label
3335 Discussions

Why can't I find the PXCMImage.ImageData.ToBitmap function in Unity platform (The Intel RealSense SDK 2.0)?

HHe6
Beginner
4,165 Views

I could apply this function in the corresponding C# version, but when I came to the same SDK in unity, it turned out to be inaccessible. What I tried to do is saving the depth image data into bitmap for my further use. The pictures below show the SDK library references and the script interface. I'll be very grateful for anyone helping me with this.

0 Kudos
1 Solution
MartyG
Honored Contributor III
2,107 Views

This instruction is used in the 2016 R2 / 2016 R3 Windows SDKs but not in the current RealSense SDK 2.0 unfortunately, as they are totally different architectures. SDK 2.0 is based on the open-source Librealsense SDK.

Are you streaming the camera's data onto a texture in Unity? To save a texture as a bitmap, a workaround may be to save the texture as a PNG using the Unity instruction EncodeToPNG in the link below.

https://docs.unity3d.com/ScriptReference/ImageConversion.EncodeToPNG.html Unity - Scripting API: ImageConversion.EncodeToPNG

View solution in original post

21 Replies
HHe6
Beginner
243 Views

Yes Marty, that is what I am thinking about right now! Maybe I should use byte[] to bitmap method to convert the original stream data in to a bitmap format. I'll try it right now and tell you the result later. Anyway, thanks so much for you kindly help!

0 Kudos
Reply