# White Balance

Source: https://forum.modalai.com/topic/3833/white-balance
Category: ESCs, Sensors and Accessories (https://forum.modalai.com/category/15/escs-sensors-and-accessories)
Tags: image-sensor
Posted: 2024-09-27 14:56:31 UTC by gitcoder
Replies: 2 · Views: 515

## gitcoder · 2024-09-27 14:56:31 UTC

I have a Starling 2 with an IMX412 Hi-Res sensor on it. Is there a way that I can set a fixed white balance for the sensor? 

I can't seem to find any documentation anywhere that mentions white balance.

Thanks!

## Reply by Alex Kushleyev (ModalAI staff) · 2024-10-05 04:36:46 UTC

Hi @gitcoder ,

Good question...

You can lock the AWB (Auto White Balance) to a specific scenario / color temperature using the following options:

https://android.googlesource.com/platform/system/media/+/master/camera/include/system/camera_metadata_tags.h#696

You need to replace AUTO to the desired color temperature: 
https://gitlab.com/voxl-public/voxl-sdk/services/voxl-camera-server/-/blob/master/src/hal3_camera_mgr.cpp#L530

```
uint8_t awbMode           =  ANDROID_CONTROL_AWB_MODE_AUTO;
```

(will consider to add this as an option to camera server)

I have not tested this in a while but i am pretty sure it works. Please let me know if it does not work. Is this sufficient for you or you want to fine tune each R, G, B channel and have those values fixed?

Alex

## Reply by gitcoder · 2024-10-10 19:17:20 UTC (in reply to Alex Kushleyev)

@Alex-Kushleyev Thanks for getting back to me. For what I am working on setting a fixed whitebalance seems like it would work, but I would at least find it useful if the white balance were tune-able. For my application I'm using the Modal drone for supervising Gaussian Splat training with an image stream, and color consistency across frames is important for good reconstruction otherwise I'll have to do color correction in the map which is a pain. Not sure if a lot of other people are using the HiRes for scene reconstructions so maybe its not universally useful though!
