How to get/set config value with user code?

I want to get/set config value with user code.
I think that it will use getConfigValue() and setConfigValue().
However, I don’t know how to specify key.
Can you give me an example about it?
(For example, Depth resolution of RealSense2Module.)

Thanks,

Hi Tsuka,

Its not really documented anywhere - much like most of the option settings sadly.
But the values are a set of dotted paths based on the elements in nuitrack.config

So for example to change the ProcessWidth - go into the nuitrack.config - find the element you want … and work out its path:

=================================
Realsense2Module”: {
Depth”: {
“ProcessMaxDepth”: 4000,
ProcessWidth”: 640,
“ProcessHeight”: 480,
“Preset”: 5,

which is Realsense2Module then Depth then ProcessWidth
that becomes Realsense2Module.Depth.ProcessWidth

Which you then call.

Nuitrack::setConfigValue(“Realsense2Module.Depth.ProcessWidth”, “320” );

A NOTE HOWEVER - you cant make many of these changes while the system is running.

Best option that we have found is to make changes just after nuitrack:init(); runs successfully that way the default values from nuitrack.config are all setup correctly first.

Then you can override any settings you need to change.

Then call DepthSensor::create();

Cheers

Westa

1 Like

Hi Westa,
Thanks, It works.

By the way, How is it implemented in what way in NuiTrack?
I think it seems to be just scaling the image, because it enable set to not supported resolutions (e.g. 1920x1080) in RealSense SDK.

Hi Tsuka,

To be honest the realsense implementation seems a little be hit and miss at times

  • maybe one of the dev’s can give some better input

Westa

Hi Tsukasa,

“ProcessWidth”, “ProcessHeight” is a resolution which raw input stream will be resized into (it will be upscaled/downsampled and cropped to fit aspect ratio if needed).

To change the raw stream, you can add “RawWidth”, “RawHeight”, “FPS” options to the Realsense2Module.Depth section, for example:

"Realsense2Module": {
"Depth": {
"RawWidth": 1280,
"RawHeight": 720,
"FPS": 30,
"Preset": 5,
"ProcessWidth": 640,
"ProcessHeight": 480,
"ProcessMaxDepth": 5000,
"LaserPower": 1.0
},
...
}

The same applies to Realsense2Module.RGB section.

RawWidth=1280, RawHeight=720, FPS=30 are default depth settings for D415. As for D435, default depth settings are RawWidth=848, RawHeight=480, FPS=30.

Please note that these changes may lead to performance issues.

1 Like

Hi olga.kuzminykh,

Thanks, I have one question.
There are not included in nuitrack.json contain in sample.
Where is documents about these options?

"Realsense2Module": {
  "Depth": {
    "RawWidth": 1280,
    "RawHeight": 720,
    "FPS": 30,
    ...
  },
  "RGB": {
    "RawWidth": 1280,
    "RawHeight": 720,
    "FPS": 30,
    ...
  }
}

Find nuitrack.config in installation folder of nuitrack. :slight_smile:

There are none frustratingly - Ive asked in the past - hopefully the will document them in more detail at some time soon.

Westa

Hey Olga,

Interesting detail - that actually may explain why the d435 crashes on startup more often the the d415.
848x480 isnt a supported format for some legacy usb3 connectors it seems … if we force those devices back to 640x480 they connect every time.

Good to know

Westa

I can’t seem to be able to load data from json array entries using these get/set methods.

For instance, take this portion of the nuitrack.config file:

{
    "RegressionSkeletonization": {
        "Filter": {
            "CombinationFilter": [
              {
                    "ThreshHold": {
                        "MaxDisplacement": 200,
                        "SmoothCameraJointVelocity": false,
                        "MinDisplacement": 50
                    }
                },
                {
                    "FABRIK": {
                        "PalmsAlignment": true,
                        "SkeletonFile": "FABRIKSkeleton.xml"
                    }
                },
                {
                    "Confidence": {
                        "ConfidenceThreshold": 0.5,
                        "CorrectHandsConfidence": true
                    }
                }
            ]
        }
    }
}

How can I access the ConfidenceThreshold value? I tried:
Nuitrack::getConfigValue("RegressionSkeletonization.Filter.CombinationFilter[2].Confidence.ConfidenceThreshold"); but it returns nothing at all.

Would be useful to have this better documented.

Hi pedromeleiro,

There’s no official support for getting/setting all the values from nuitrack.config. All available options are listed in Nuitrack Knowledge Base