librealsense icon indicating copy to clipboard operation
librealsense copied to clipboard

Sudden Drop in Depth Map Quality Until System Restart

Open jrecasens opened this issue 1 year ago • 10 comments

Hello,

I have an IoT edge device using two D456 cameras, running 24/7 to record moving objects. The application has been stable so far, but today I encountered a new issue: all .bag recordings suddenly dropped in quality one after another, and only a system restart (Ubuntu 22) resolved it.

As shown below, the depth map quality degraded significantly, with many objects missing or displaying horizontal grainy dark bands (for comparison, normal operation is shown on the left). I am confident that this is not due to camera settings, as the same setup works well in normal conditions. The only change was a brief event with increased water and dust particles. However, even after the event ended and we cleaned the lenses, subsequent recordings remained poor.

problematic

Could it be that drastic changes in the scene are causing the internal RealSense algorithm to miscalculate and lose its ability to perform correctly? While a restart fixed the issue, I’d like to understand the root cause to prevent this from recurring in the future.

jrecasens avatar Oct 04 '24 13:10 jrecasens

Hi @jrecasens At the time of day / night that the problem began, could there have been high humidity in the environment like in the recent D456 case at the link below, please?

https://support.intelrealsense.com/hc/en-us/community/posts/34007357457555

Another cause of sudden image degradation could be if the camera faced directly towards a strong light source such as the sun. In those circumstances, a reset could correct the issue. The other ways to resolve it would be if the front of the camera was covered over for several seconds with auto-exposure enabled, or if the light source moved so it was no longer shining directly into the camera, or if the camera was turned away from the light source so that auto-exposure could auto-correct the image.

MartyG-RealSense avatar Oct 04 '24 14:10 MartyG-RealSense

Thank you for your insights. I cannot confirm if condensation is the issue since the device is currently unreachable until December. However, I do have auto-exposure enabled, and I've observed that water particles or condensation might be causing bright light reflections momentarily.

To address this, I'm considering writing a script to detect these specific events and programmatically trigger a restart of the camera. Do you have any recommendations for monitoring this using pyrealsense?

Looking forward to your suggestions!

jrecasens avatar Oct 04 '24 15:10 jrecasens

It is possible to set up an IF logic condition in a loop to monitor constantly, with a hardware_reset() command triggered if the condition is met. An example would be if the exposure value dropped below a certain number, or a certain percentage of the depth pixels (such as 50% or more) had a depth value of 0 (indicating that something had gone wrong with the image).

MartyG-RealSense avatar Oct 04 '24 16:10 MartyG-RealSense

This is going to be tricky as it depends on rules coming from .bag metadata and also on depth processing to detect this issue. False Positives are not acceptable, a hard device restart takes 45 seconds on our side.

Thanks Marty.

jrecasens avatar Oct 04 '24 17:10 jrecasens

You could reduce the number of erroneous depth values by applying the High Accuracy camera configuration preset, and perhaps also set a high value for an Advanced Mode setting called DS Second Peak Threshold (such as '625' - the default is 325) so that the SDK is very strict about excluding depth coordinates that it is not highly confident in.

You can test both of these settings (the preset and DS Second Peak Threshold) in the RealSense Viewer. The 'High Accuracy' preset is under the 'Presets' drop down menu near the top of the Viewer's options side-panel, whilst Second Peak Threshold can be found under 'Stereo Module > Advanced Controls > Depth Control'.

MartyG-RealSense avatar Oct 05 '24 15:10 MartyG-RealSense

I've identified a common issue in the corrupted .bag files: the Depth Actual Exposure value remains constant at 1 for all frames. I plan to use this flag but is not enough, as some correct recordings also have 1 as actual exposure.

jrecasens avatar Oct 07 '24 17:10 jrecasens

Does it make a difference if you record with auto-exposure disabled?

MartyG-RealSense avatar Oct 08 '24 12:10 MartyG-RealSense

Hi @jrecasens Do you require further assistance with this case, please? Thanks!

MartyG-RealSense avatar Oct 14 '24 07:10 MartyG-RealSense

after changing some exposure settings I have not experienced this issue again. I will update if anything changes.

jrecasens avatar Oct 14 '24 13:10 jrecasens

Okay, that's good to hear - thanks very much for the update!

MartyG-RealSense avatar Oct 14 '24 15:10 MartyG-RealSense

Hi @jrecasens Do you require further assistance with this case, please? Thanks!

MartyG-RealSense avatar Oct 28 '24 07:10 MartyG-RealSense

Case closed due to no further comments received.

MartyG-RealSense avatar Nov 04 '24 11:11 MartyG-RealSense