How to set 0.1 mm precision for Depth values using OrbbecSDK_CSharp and Astra2

Hi,

I prepared a C# code to get Aligned/synced depth and rgb images from an Astra2 camera.

In the OrbbecViewer I see an option Under Depth Advanced Controls to set the Deph Unit to 0.1 mm.

How to set this by using OrbbecSDK_CSharp?
I coudl not find any methiod in config or pipeline.

I set the piplene on the following way:

  Pipeline pipeline = new();

  StreamProfile colorProfile = pipeline.GetStreamProfileList(SensorType.OB_SENSOR_COLOR).GetVideoStreamProfile(width: 1920, height: 1080, Orbbec.Format.OB_FORMAT_RGB, fps: 30);
  StreamProfile depthProfile = pipeline.GetStreamProfileList(SensorType.OB_SENSOR_DEPTH).GetVideoStreamProfile(width: 1600, height: 1200, Orbbec.Format.OB_FORMAT_Y16, fps: 30);
  StreamProfile accelProfile = pipeline.GetStreamProfileList(SensorType.OB_SENSOR_ACCEL).GetAccelStreamProfile(AccelFullScaleRange.OB_ACCEL_FS_UNKNOWN,AccelSampleRate.OB_SAMPLE_RATE_100_HZ);
  StreamProfile gyroProfile = pipeline.GetStreamProfileList(SensorType.OB_SENSOR_GYRO).GetGyroStreamProfile(GyroFullScaleRange.OB_GYRO_FS_UNKNOWN,GyroSampleRate.OB_SAMPLE_RATE_100_HZ);
  Config config = new();
  config.EnableStream(colorProfile);
  config.EnableStream(depthProfile);
  config.EnableStream(accelProfile);
  config.EnableStream(gyroProfile);
  config.SetAlignMode(AlignMode.ALIGN_D2C_SW_MODE);
  pipeline.EnableFrameSync();
  pipeline.Start(config);

Is the next code returns the current value of depth unit? (Current value is 1 )

float depthValueScale = depthFrame.GetValueScale();

C# wrapper doesn’t support this yet. You can try DepthUnitControl sample in Orbbec SDK.GitHub - orbbec/OrbbecSDK: Orbbec SDK C/C++ base core lib

Thanks Nathan.

Finally, I found this in the C# wrapper under the Device, which can be obtained from a Pipeline

private static Orbbec.DepthPrecisionLevel DepthPrecision = Orbbec.DepthPrecisionLevel.OB_PRECISION_0MM1;

Orbbec.Device device = pipeline.GetDevice();
device.SetIntProperty(PropertyId.OB_PROP_DEPTH_PRECISION_LEVEL_INT, (int) DepthPrecision);