Unable to Change IR Camera Exposure in OrbbecSDK_CSharp Due to 'Property not Writeable' Error

English Version

Title: Unable to Change IR Camera Exposure - “Property not Writeable” Error (Orbbec Femto Bolt, C# SDK)

Hello,

I am currently using the Orbbec Femto Bolt with firmware version 1.1.2.
I am developing using OrbbecSDK_CSharp and trying to adjust the exposure value of the IR camera.

However, I keep encountering the error “Property not Writeable”, preventing me from changing the exposure value.

  • In Orbbec Viewer, I noticed that adjusting the min and max values in the visualization section under IR settings successfully changes the exposure.

  • To understand how this works, I checked the open-source code of Orbbec Viewer (Orbbec-Sample-Viewer) and found how exposure is modified in C++ code.

  • I also followed the official Orbbec documentation on IR parameter settings ([IR Parameter Settings]) to implement the same logic in C#.

    Pipeline pipeline = new Pipeline();
    Device device = pipeline.GetDevice();
    // Close IR AE
    device.SetBoolProperty(PropertyId.OB_PROP_IR_AUTO_EXPOSURE_BOOL, false);
    // set IR exposure
    device.SetIntProperty(PropertyId.OB_PROP_IR_EXPOSURE_INT, 100);
    // set IR gain
    device.SetIntProperty(PropertyId.OB_PROP_IR_GAIN_INT, 64);
    

Despite this, I still get the “Property not Writeable” error when trying to change the exposure value in C#.

Is there any way to resolve this issue?
Thank you!


한국어 버전

안녕하세요,

현재 Orbbec Femto Bolt를 사용 중이며, 펌웨어 버전은 1.1.2입니다.
**[OrbbecSDK_CSharp]**를 사용하여 개발을 진행하고 있으며, IR 카메라의 노출 값을 변경하고자 합니다.

그런데, “Property not Writeable” 오류가 발생하여 값을 변경할 수 없습니다.

  • Orbbec Viewer에서는 IR 섹션의 visualization에서 min, max 값을 조정하면 노출 값이 변경되는 것을 확인했습니다.
  • 그래서 Orbbec Viewer의 오픈소스 코드([Orbbec-Sample-Viewer])를 참고하여 C++ 코드에서 노출 값을 변경하는 방식을 확인했습니다.
  • 그리고 Orbbec 공식 문서([IR Parameter Settings])를 참고하여 C# 코드에서도 동일하게 적용하려고 했습니다.
    Pipeline pipeline = new Pipeline();
    Device device = pipeline.GetDevice();
    // Close IR AE
    device.SetBoolProperty(PropertyId.OB_PROP_IR_AUTO_EXPOSURE_BOOL, false);
    // set IR exposure
    device.SetIntProperty(PropertyId.OB_PROP_IR_EXPOSURE_INT, 100);
    // set IR gain
    device.SetIntProperty(PropertyId.OB_PROP_IR_GAIN_INT, 64);
    

하지만, 위와 같이 진행해도 여전히 “Property not Writeable” 오류가 발생하여 IR 카메라의 노출 값을 변경할 수 없습니다.

이 문제를 해결할 수 있는 방법이 있을까요?
감사합니다.


Can I enquiry how did you change the exposure value with min&max value under visualization setting? I think Visual min max range is the camera visible range setting.

// The method applied was not exposure value adjustment but replacing only the IR data visualization part with the Orbbec test viewer.

Orbbec IR Camera Brightness Adjustment Issue Resolution Process

1. Problem Situation

:pushpin: Unable to Adjust Brightness When Using Orbbec IR Camera

While utilizing the IR (Infrared) stream of the Orbbec Femto 3D camera in a Windows Forms (.NET) environment, an issue arose where brightness adjustment was not possible.

By default, the brightness of the IR camera cannot be adjusted via hardware, requiring software post-processing of received pixel data for visualization. However, Orbbec’s official SDK did not provide an IR brightness adjustment feature, necessitating the conversion of 16-bit (Y16) pixel values into an 8-bit (0~255) range for proper display.

2. Cause Analysis

:mag: 2.1. Verification of IR Camera Data Structure

The IR data from the Orbbec camera is provided in 16-bit (Y16) format, meaning pixel values are represented in the 0~65535 range, necessitating a conversion to the 8-bit (0~255) format used in standard displays.

:mag: 2.2. Analysis of Orbbec’s C++ Viewer

Orbbec’s official C++ viewer code allows brightness adjustment by modifying and values, normalizing IR data within the specified range for display.

ImGui::SliderInt("IR Min", &ir_min, 0, 4000);
ImGui::SliderInt("IR Max", &ir_max, 0, 4000);

In this code, when users modify the IR Min/Max values, the pixel brightness is adjusted accordingly before being displayed.

However, the C#-based .NET environment does not provide this adjustment functionality by default, requiring a custom implementation.

3. Solution

:white_check_mark: 3.1. Applying a Normalization Algorithm to IR Pixel Data

The 16-bit data (065535) from the IR camera must be converted into 8-bit (0255). The following normalization formula was applied:

target_pixel = \frac{raw_pixel - min}{max - min} \times 255
  • raw_pixel: Original pixel value from the Orbbec camera (0~65535 range)
  • min: User-defined minimum IR brightness value
  • max: User-defined maximum IR brightness value
  • target_pixel: Converted 8-bit (0~255) pixel value

:white_check_mark: 3.2. Adding IR Brightness Adjustment in C#

The SliderInt function from the C++ viewer was implemented in C# using NumericUpDown + TrackBar UI components.

private void trackBarIRMin_Scroll(object sender, EventArgs e)
{
    irMin = (ushort)trackBarIRMin.Value;
    if (irMin >= irMax) irMin = (ushort)(irMax - 1);
    numericUpDownIRMin.Value = irMin;
}

private void trackBarIRMax_Scroll(object sender, EventArgs e)
{
    irMax = (ushort)trackBarIRMax.Value;
    if (irMax <= irMin) irMax = (ushort)(irMin + 1);
    numericUpDownIRMax.Value = irMax;
}
  • Integrated TrackBar (slider) and NumericUpDown (numeric input) controls, allowing users to adjust IR Min/Max values.
  • Automatically ensures that IR Min does not exceed IR Max.

:white_check_mark: 3.3. Converting 16-bit IR Data to 8-bit RGB

public static byte[] ConvertIRToRGBData(byte[] rawData, OBFormat format, ushort min, ushort max)
{
    int length = rawData.Length;
    byte[] output = new byte[length * 3];

    for (int i = 0; i < length; i++)
    {
        ushort value = BitConverter.ToUInt16(rawData, i * 2);
        byte normalized = (byte)Math.Clamp((value - min) * 255 / (max - min), 0, 255);

        output[i * 3] = normalized; // R
        output[i * 3 + 1] = normalized; // G
        output[i * 3 + 2] = normalized; // B
    }
    return output;
}
  • Normalizes IR pixel values within the user-defined min~max range.
  • Converts normalized pixel values into the 8-bit (0~255) range.
  • Applies the same value to the R, G, and B channels to maintain a grayscale image.

4. Final Results

:white_check_mark: Added Brightness Adjustment Feature: Users can modify IR brightness in real-time via sliders.

:white_check_mark: Implemented C+±Based IR Viewer Functionality in C#: Successfully replicated the C++ functionality in a .NET environment.

:white_check_mark: Improved UI/UX: Integrated TrackBar & NumericUpDown for intuitive brightness control.

:white_check_mark: Enhanced Image Saving: Files are saved with IR brightness settings included in the filename (IR_1000-3000_20250305_153000.png).