C# Depth frame does not match with RGB Frame
Hi,
I have a C# software created for taking snapshots with D415 camera. Reviewing the snapshots I have discovered a stange situation in some cases.
RGB image does not shows the same scene as depth frame.
I'm using WaitForFrames method and taking depth and color frame in same iteration.
using (var frames = _irsPipeline.WaitForFrames(2000)) // Before 2000
{
var colorFrame = frames.ColorFrame.DisposeWith(frames);
var depthFrame = frames.DepthFrame.DisposeWith(frames);
var colorizedDepth = _depthFilterColorizer.Process<VideoFrame>(depthFrame).DisposeWith(frames);
}
I'm using frame.CopyTo() method to copy frame bytes into managed memory and save frame data into Dtos to be saved to file after being captured.
I have this code into for loop for capture 10 depth frames. I have found also some strange cases where al 10 depth frames saved to file are the same (same SHA256 hash). It's possible that WaitForFrames() return same frame if it is called very fast?
I have both RGB and depth pipelines configured with 30 fps.
With regards,
-
Hi Juan Diezyanguas Are the depth frames saved correctly if the C# script at the link below is used, please?
https://github.com/IntelRealSense/librealsense/issues/8752#issuecomment-891683173
-
Hi,
I was saving depth frame as colorized, and those jpg images was the ones that I have mentioned that have same SHA256 hash.
My problem is not an error saving frames. My problem is related to the strange situations that I have mentioned that have ocurred in some times.
- I have cases that depth frame doesn't match with the same scene that rgb frame is showing at the same time.
- I have other cases that seems that all depth frames that I have saved have the same SHA256. So that why I asked if it's possible for WaitForFrames() method to return same frame if it's called multiple times very fast.
With regards,
-
RGB and depth frames have a temporal offset bounded by a period of one frame, and wait_for_frames() finds the best match between their timestamps.
https://github.com/IntelRealSense/librealsense/issues/1548#issuecomment-389070550
If a dropped frame occurs then if wait_for_frames() is being used the SDK returns back to the last known good frame.
-
Hi MartyG
Thanks for your reply. So it seems that there is no way to ensure that RGB and depth frames matchs to the same timestamps. Is that true? Why there is not fix for this? I think this could be a very inconvenient of the hardware to apply it as an stable solution.
I have seen in your link that there is an align filter. It is refered to this cases?
With regards,
-
If the FPS speed of depth and RGB are the same then sync of their timestamps should kick in automatically, as described at the link below.
https://github.com/IntelRealSense/librealsense/issues/11203#issuecomment-1348828363
Please sign in to leave a comment.
Comments
5 comments