# Unable to Change IR Camera Exposure in OrbbecSDK\_CSharp Due to 'Property not Writeable' Error

**URL:** <https://3dclub.orbbec3d.com/t/unable-to-change-ir-camera-exposure-in-orbbecsdk-csharp-due-to-property-not-writeable-error/4392>\
**Category:** Technical Support & Q&A\
**Created:** [March 4, 2025, 5:41am UTC](https://3dclub.orbbec3d.com/t/unable-to-change-ir-camera-exposure-in-orbbecsdk-csharp-due-to-property-not-writeable-error/4392 "2025-03-04T05:41:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![wndnjs5804](https://3dclub.orbbec3d.com/letter_avatar_proxy/v4/letter/w/a4c791/32.png) [@wndnjs5804](https://3dclub.orbbec3d.com/u/wndnjs5804)\
**Post date:** [March 4, 2025, 5:41am UTC](https://3dclub.orbbec3d.com/t/unable-to-change-ir-camera-exposure-in-orbbecsdk-csharp-due-to-property-not-writeable-error/4392/1 "2025-03-04T05:41:39Z")

</div>

### **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](https://github.com/orbbec/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](https://github.com/orbbec/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#.

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# 코드에서도 동일하게 적용하려고 했습니다.

```auto
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 카메라의 노출 값을 변경할 수 없습니다.**

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

* * *

---

<div class="post-metadata">

**Author:** ![Nathan](https://3dclub.orbbec3d.com/letter_avatar_proxy/v4/letter/n/c5a1d2/32.png) [@Nathan](https://3dclub.orbbec3d.com/u/Nathan)\
**Post date:** [March 5, 2025, 3:46pm UTC](https://3dclub.orbbec3d.com/t/unable-to-change-ir-camera-exposure-in-orbbecsdk-csharp-due-to-property-not-writeable-error/4392/2 "2025-03-05T15:46:14Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![wndnjs5804](https://3dclub.orbbec3d.com/letter_avatar_proxy/v4/letter/w/a4c791/32.png) [@wndnjs5804](https://3dclub.orbbec3d.com/u/wndnjs5804)\
**Post date:** [March 11, 2025, 1:16am UTC](https://3dclub.orbbec3d.com/t/unable-to-change-ir-camera-exposure-in-orbbecsdk-csharp-due-to-property-not-writeable-error/4392/3 "2025-03-11T01:16:56Z")

</div>

// 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

### 📌 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

### 🔍 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.

### 🔍 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.

```auto
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

### ✅ 3.1. Applying a Normalization Algorithm to IR Pixel Data

The **16-bit data (0~~65535) from the IR camera must be converted into 8-bit (0~~255)**. The following normalization formula was applied:

```auto
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

### ✅ 3.2. Adding IR Brightness Adjustment in C#

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

```auto
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**.

### ✅ 3.3. Converting 16-bit IR Data to 8-bit RGB

```auto
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

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

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

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

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