View my account

Modify HighAccuracy preset to allow lower confidence points

Comments

4 comments

  • MartyG

    Hi Toni Divic  It would be possible to create a custom preset file in the RealSense Viewer tool by selecting Medium Accuracy, tweaking Viewer settings and then exporting the adjustments to a new preset with the Save Json option in the side-panel beside the camera name.

     

    The code for loading in a custom json is different to the method for setting a built-in preset though.  It is more complex and is more prone to errors occurring when the script is run. 

     

    The strategy that may work best for you is to continue using the built-in Medium Density preset and adjust the Second Peak Threshold Advanced Mode setting using program code.  The default value of Second Peak Threshold is '325'. 

     

    This parameter will disqualify depth pixel, if the "second best" match is too close to the best match.  Reducing the value downwards should make its confidence checking more lenient.  Information about implementing a change to Second Peak Threshold with Python code can be found at the link below.

    https://github.com/IntelRealSense/librealsense/issues/10224#issuecomment-1060412603

     

    There is not a C++ reference available for changing Second Peak Threshold, though a general reference documentation for accessing Advanced Mode options with C++ can be found here:

    https://github.com/IntelRealSense/librealsense/blob/master/doc/rs400/rs400_advanced_mode.md

    0
    Comment actions Permalink
  • Toni Divic

     

    Couple of follow-up questions though based on what you said:

    1. Is there a Medium Accuracy preset? I'm not seeing that, I see High Accuracy or Medium Density (among a few others)
    2. We're launching the cameras using ROS2 and load a specified JSON at runtime, so ideally I'd like to avoid any programmatic adjustments. Ideally I'd like to just tune a new custom preset in RealSense Viewer then use that. Obviously there are a large number of parameters, but I'm curious if there's one or two params that can basically relax the High Accuracy stringency a bit and accept lower confidence depth points. Would that be the DS Second Peak Threshold that you mentioned?
    3. Another option I'm considering is just comparing the High Accuracy values to the Medium Density values for all Advanced Controls params in RealSense Viewer, then taking the midpoint of each to create a "Medium-High Accuracy" preset. Any concerns with doing that?
    0
    Comment actions Permalink
  • MartyG

    1.  No, there is not a built-in Medium Accuracy preset.  Medium Density fulfils that role.  Of the other Presets available, I would recommend trying Default to see whether it meets your needs.

     

    2.  Loading a json preset with ROS during launch is usually less prone to problems than doing it in C++ / Python language.  Yes, you can define a value for DS Second Peak Threshold in a json.  Its json parameter name is param-secondpeakdelta.  For example:

    "param-secondpeakdelta": "325"

     

    3.  Advanced Control features interact with each other in complex ways, controlled automatically by machine learning algorithms, and the purpose of most of the features is not documented because they are algorithm-controlled.  So I would recommend just altering param-secondpeakdelta and leaving the rest of the values unaltered on their defaults, otherwise halving the values of all parameters could cause extensive and unpredictable changes to the image.

    0
    Comment actions Permalink
  • Toni Divic

    Great, thanks so much for the help. I'll try your suggestions and see where it leads

    0
    Comment actions Permalink

Please sign in to leave a comment.