Sync depth and color

I am generating a depth map from the point cloud points, and to fill in the missing data I want to look at the closest matching color frame. I am able to generate a depth image (I generate it when OnDepthAvailable is called), and I see that the TangoAR unity example gets the color frames when OnExperimentalTangoImageAvailable is called.

This is from the TangoAR unity example:

    /// <summary> /// This will be called when a new frame is available from the camera. /// /// The first scan-line of the color image is reserved for metadata instead of image pixels. /// </summary> /// <param name="cameraId">Camera identifier.</param> public void OnExperimentalTangoImageAvailable(TangoEnums.TangoCameraId cameraId) {     if (cameraId == TangoEnums.TangoCameraId.TANGO_CAMERA_COLOR)     {         m_screenUpdateTime = VideoOverlayProvider.RenderLatestFrame(TangoEnums.TangoCameraId.TANGO_CAMERA_COLOR);          // Rendering the latest frame changes a bunch of OpenGL state.  Ensure Unity knows the current OpenGL state.         GL.InvalidateState();     } } 

However I want the frame right after the depth frame, not the latest frame available.

How can I sync the two as close as possible? Looking at the C RBG Depth sync example didn't help me. I understand that depth and color use the same camera, and that it can't do both at the same time (1 depth for every 4 color frames).


Category: unity3d Time: 2016-07-31 Views: 3

Related post

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development


Front-end development


development tools

Open Platform

Javascript development

.NET development

cloud computing


Copyright (C), All Rights Reserved.

processed in 0.217 (s). 12 q(s)