View my account

The instability of depth value and the correction method of depth error

Comments

14 comments

  • MartyG

    Hello, if the wall is plain with little or no texture on it, and especially if its color is white, then the camera will have difficulty analyzing it for depth information when placed at a distance from the wall.  If your wall is plain then please ensure that the camera's infrared dot pattern projector is enabled as projecting the invisible pattern onto the wall will aid the camera in accurately measuring depth from a wall or similarly low-textured surfaces.

     

    import pyrealsense2 as rs
    pipeline = rs.pipeline()
    config = rs.config()
    pipeline_profile = pipeline.start(config)
    device = pipeline_profile.get_device()
    depth_sensor = device.query_sensors()[0]
    if depth_sensor.supports(rs.option.emitter_enabled):
    depth_sensor.set_option(rs.option.emitter_enabled, 1)
    0
    Comment actions Permalink
  • 19829127419

    Oh, OK. I'll try to measure something else. In addition, I would like to ask what is the realization of these lines of code you gave me?

    0
    Comment actions Permalink
  • MartyG

    When the emitter is enabled, a built-in projector component in the camera casts a pattern of dots onto surfaces in front of it.  This pattern is invisible to humans but can be seen by the camera.  The camera uses these dots as a surface texture to aid it in measuring the surface's depth.

     

    0
    Comment actions Permalink
  • 19829127419

    MartyG, I wonder if the instability of the depth values is related to the quality of the camera calibration, or is it due to the unfiltered depth image?

    0
    Comment actions Permalink
  • MartyG

    Performing a calibration can improve the depth image quality.  In the case of walls, it can help to remove distortions on the image such as a flat wall being curved.  It is more likely though that the camera is having difficulty finding texture on the wall to analyze when the camera is moved further away.  Surfaces are also more difficult for the camera to read if they are colored dark gray or black.

     

    If you have access to the RealSense Viewer tool then you could compare the depth measurements that it provides to the measurements in your Python application.  If the Viewer's measurements are relatively correct then the issue may be in your Python code.  

     

    If you launch the Viewer and enter its 3D point cloud mode by clicking on the 3D option in the top corner of the Viewer window and then enable the Stereo Module, you can check the depth measurement by hovering the mouse cursor over a particular area of the image and looking at the values displayed on the text overlay that appears.

    0
    Comment actions Permalink
  • 19829127419

    Does the depth image not being filtered affect the depth value?

    0
    Comment actions Permalink
  • MartyG

    If post-processing filters are not applied to the depth image then it can result in a lower quality image than if filters are applied, yes.  This principle can be demonstrated by enabling the depth image in the RealSense Viewer and then clicking on the blue icon beside 'Post Processing' to disable all of the post-processing filters simultaneously (as the Viewer applies a range of filters by default).  

     

    Program scripts do not enable any post-processing filters by default, and they have to be deliberately programmed into a script in order to apply them to the depth image produced by the script.

    0
    Comment actions Permalink
  • 19829127419

    I'm sorry, your answer doesn't quite agree with my question.

    0
    Comment actions Permalink
  • MartyG

    I meant that the depth image not being filtered can affect the depth value, yes, if the absence of filtering results in an image with inaccurate or fluctuating depth values.

    0
    Comment actions Permalink
  • 19829127419

    Then I would like to ask again whether there is a relationship between the fluctuation of depth value and camera calibration, and whether it is necessary to calibrate the camera?

    0
    Comment actions Permalink
  • MartyG

    There is a relationship in the sense that a poor quality depth image could cause fluctuation of depth values.  And so if a calibration is performed to improve the quality of the depth image, the depth values may also fluctuate less.

    0
    Comment actions Permalink
  • 19829127419

    Can I use self-calibration or dynamic calibration? In addition, how do I filter, is there a code?

    0
    Comment actions Permalink
  • MartyG

    You can use either self-calibration or Dynamic Calibration.  If you only need to calibrate depth and not also RGB then the On-Chip self calibration tool will be the easiest method as it can be accessed from the 'More' option in the RealSense Viewer's options side-panel without having to install additional software.  A guide to self-calibration can be found at the link below.

    https://dev.intelrealsense.com/docs/self-calibration-for-depth-cameras

     

    Here is an example of Python code for setting up and applying post-processing filters.

    https://github.com/IntelRealSense/librealsense/issues/1672#issuecomment-387438447

    0
    Comment actions Permalink
  • 19829127419

    Well, thank you very much for your patience in answering my questions! I will try it according to the method you gave, thanks again!

    0
    Comment actions Permalink

Please sign in to leave a comment.