Software Archive
Read-only legacy content
17061 Discussions

Mapping depth to color with high resolution results in low frame rate

Austin_C_
Beginner
341 Views

Hello,

Using Unity, I have created a projected image by mapping the depth image to the color image. So my projected image is 1920x1080, and my color image is 1920x1080. The projected image is using depth images of 640x480 at 60 fps.

I have created a simple scene where I am only making RealSense calls. I have two planes, which use the projected image and color image that I am creating.

Here's a screenshot of Unity's profiler for this scene:

profiler.png

In order to get 30 fps, we must have less than 33 ms on the CPU each frame. Here are some of the most significant RealSense function calls and the time (ms) they are taking to execute for an example frame:

CreateDepthImageMappedToColor() - 15.06 ms

ImageData.ToTexture2D()  - 9.64 ms (for the projected image)

PXCMImage.AcquireAccess() - 4.06 ms (access the projected image)

ImageData.ToTexture2D()  - 19.69 ms (for the color image)

Total: 48.45 ms (15.45 ms over the requirement)

Is there any way to improve this or are we stuck with a low frame rate if we want to use 1920x1080 resolution projection in Unity?

Is there an alternate way to get a texture from the camera, perhaps using multi-threading? Maybe that could help with performance.

Also, I am calling AcquireFrame(false, 0), which is a tip I read to improve performance in Unity.

Here are my computer specs:

CPU: Intel Core i7-4790S CPU @ 3.2GHz
GPU: Nvidia Quadro K4000
12 GB Ram
Windows 8.1 64 bit
USB 3.0
DesktopModel: Asus Desktop PC M51AD

Any help is greatly appreciated. Thank you.

0 Kudos
0 Replies
Reply