Items with no label
3335 Discussions

Rs400 Visual Presets - how to use

SChop3
Novice
2,814 Views

Hello,

I'm trying to alter the depth control parameters of the R435 camera using the visual presets. I've found a way to load presets from a Json file in advanced mode: https://github.com/IntelRealSense/librealsense/blob/master/doc/rs400/rs400_advanced_mode.md https://github.com/IntelRealSense/librealsense/blob/master/doc/rs400/rs400_advanced_mode.md.

However, the .Net wrapper (I'm using .Net) has a type Rs400VisualPresets which contains all of the presets found in the viewer.

The Json approach seems a little involved, is there a simpler method which uses the enums in the wrapper?

Thanks

0 Kudos
1 Solution
jb455
Valued Contributor II
733 Views

Yep, you can use one of the presets like so:

PipelineProfile profile = pipeline.Start(cfg);

var depthSensor = profile.Device.QuerySensors()[0];

if (depthSensor.Options[Option.VisualPreset].Supported)

depthSensor.Options[Option.VisualPreset].Value = Rs400VisualPreset.HighDensity;

I think that the list of presets might not be finalised though; I read in the comments of one of the samples that they might change. Keep an eye on it when new versions come out!

View solution in original post

0 Kudos
3 Replies
MartyG
Honored Contributor III
733 Views

The Visual Presets guide says that as an alternative to using a JSON file, "the user can also modify the settings via the Advanced Mode menu and save a customized user preset."

https://github.com/IntelRealSense/librealsense/wiki/D400-Series-Visual-Presets D400 Series Visual Presets · IntelRealSense/librealsense Wiki · GitHub

0 Kudos
jb455
Valued Contributor II
734 Views

Yep, you can use one of the presets like so:

PipelineProfile profile = pipeline.Start(cfg);

var depthSensor = profile.Device.QuerySensors()[0];

if (depthSensor.Options[Option.VisualPreset].Supported)

depthSensor.Options[Option.VisualPreset].Value = Rs400VisualPreset.HighDensity;

I think that the list of presets might not be finalised though; I read in the comments of one of the samples that they might change. Keep an eye on it when new versions come out!

0 Kudos
SChop3
Novice
733 Views

Great stuff,

This works great thanks, only one very minor change to the code in case someone else wants to use it.

The Enum needs casting to a float as below.

depthSensor.Options[Option.VisualPreset].Value = (float)Rs400VisualPreset.HighDensity;

0 Kudos
Reply