1

I want to modify the advanced depth visualisation parameters of my Intel Realsense D405 camera in python using the pyrealsense2 library.

I am currently able to modify these parameters in the realsense-viewer application:

Realsense camera depth visualisation parameters

I am able to export this to a json file. I would assume I can import these settings in python somehow and get the depth visualisation I desire but I can´t figure it out.

ChrisGPT was on strike
  • 127,765
  • 105
  • 273
  • 257
arnecools
  • 13
  • 2

1 Answers1

0

The librealsense package has an example for using the advanced parameters, which include the advanced depth parameters you're looking for: https://github.com/IntelRealSense/librealsense/blob/master/wrappers/python/examples/python-rs400-advanced-mode-example.py
More specifically to your question, the object returned from rs.rs400_advanced_mode(dev) (line 28 in the example) has a load_json method which you could use to load the exported settings into your code.

Adid
  • 1,504
  • 3
  • 13
  • I ran the script in that example and it just returned this: `No D400 product line device that supports advanced mode was found`. I looked up my device product ID, which is 0B5B. This is not in the list of product id's specified at the beginning of the script: `DS5_product_ids = ["0AD1", "0AD2", "0AD3", "0AD4", "0AD5", "0AF6", "0AFE", "0AFF", "0B00", "0B01", "0B03", "0B07", "0B3A", "0B5C"]`. Is there any chance there is some other way to get around this? – arnecools Apr 03 '23 at 10:37
  • Update: I just removed the first control of the script where it checks for the camera support and it worked like a charm. I am guessing the example on GitHub is outdated since the Realsense D405 camera came out in April 2022 while the script was last edited on 08/02/2021. Thank you! – arnecools Apr 03 '23 at 10:51