# Adjusting for dim light

**URL:** <https://forum.opencv.org/t/adjusting-for-dim-light/13607>\
**Category:** Uncategorized\
**Created:** [June 20, 2023, 4:09pm UTC](https://forum.opencv.org/t/adjusting-for-dim-light/13607 "2023-06-20T16:09:56Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![portsample](https://avatars.discourse-cdn.com/v4/letter/p/da6949/32.png) [@portsample](https://forum.opencv.org/u/portsample)\
**Post date:** [June 20, 2023, 4:09pm UTC](https://forum.opencv.org/t/adjusting-for-dim-light/13607/1 "2023-06-20T16:09:56Z")

</div>

We have deployed a USB camera using OpenCV to a remote site to document fish passage in a river. Daylight imagery from the camera is very good to excellent. At night, blue underwater LED spotlights are switched on. The lights are quite bright and illuminate a large area of bottom. However, this does not show up in the captured images. The blue lamps are just barely visible in the imagery. Is it possible to adjust OpenCV settings to accommodate for this? I am assuming that making such an adjustment may negatively impact imagery collected during daylight. Solutions and useful insight would be highly appreciated. Thanks.

---

<div class="post-metadata">

**Author:** ![crackwitz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/crackwitz/32/14_2.png) [@crackwitz](https://forum.opencv.org/u/crackwitz)\
**Post date:** [June 20, 2023, 4:41pm UTC](https://forum.opencv.org/t/adjusting-for-dim-light/13607/2 "2023-06-20T16:41:44Z")

</div>

“bright” is relative. you likely did _not_ deploy daylight-bright illumination, just enough for people to think it’s bright.

set the camera to auto-exposure. if the camera driver has it, enable “low-light”, which extends exposure time beyond a single frame, causing a lower frame rate but less noise.

also look up the physical unit “lux”, then compare daylight (blue sky, cloudy) to any kind of artificial lighting. your biological eyes have a lot wider dynamic range than most technology. cameras have a certain dynamic range of the sensor itself, and they extend that using exposure time. it’s still no match.

OpenCV can only give you those parameters that can be adjusted through the standard system APIs. some cameras have additional parameters that manufacturers have to expose through their own “camera control apps”.

---

<div class="post-metadata">

**Author:** ![portsample](https://avatars.discourse-cdn.com/v4/letter/p/da6949/32.png) [@portsample](https://forum.opencv.org/u/portsample)\
**Post date:** [June 20, 2023, 6:06pm UTC](https://forum.opencv.org/t/adjusting-for-dim-light/13607/3 "2023-06-20T18:06:57Z")

</div>

Thanks for the reply. The “new” system running OpenCV uses an AliExpress USB webcam,  
([https://www.aliexpress.us/item/3256804007074276.html](https://www.aliexpress.us/item/3256804007074276.html)). Next to it is the “old system” which uses an all-in-one security camera, this system is able to make use of the blue underwater spotlights to view passing fish at night. The Aliexpress camera is exceedingly basic with no accompanying driver software. I was hoping there might be a setting within OpenCV that could help with this. Thanks again for the reply.

---

<div class="post-metadata">

**Author:** ![crackwitz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/crackwitz/32/14_2.png) [@crackwitz](https://forum.opencv.org/u/crackwitz)\
**Post date:** [June 20, 2023, 9:53pm UTC](https://forum.opencv.org/t/adjusting-for-dim-light/13607/4 "2023-06-20T21:53:51Z")

</div>

> [@portsample](#):
>
> I was hoping there might be a setting within OpenCV that could help with this.

I didn’t say there weren’t.

browse the capture properties of the VideoCapture object.

there’s probably some auto exposure flag.

that’s not “in OpenCV”, that is merely setting something in the generic USB Video driver, which tells the camera to do it.

---

<div class="post-metadata">

**Author:** ![portsample](https://avatars.discourse-cdn.com/v4/letter/p/da6949/32.png) [@portsample](https://forum.opencv.org/u/portsample)\
**Post date:** [September 11, 2023, 10:24pm UTC](https://forum.opencv.org/t/adjusting-for-dim-light/13607/5 "2023-09-11T22:24:02Z")

</div>

The “daylight” system using OpenCV worked great.  
Link: [www.youtube.com/watch?v=xwuNq1DPYjY](http://www.youtube.com/watch?v=xwuNq1DPYjY)  
The separate “night” system (non-OpenCV) did as well with it’s underwater blue lights.  
Ideally, we could keep the lights and get rid of the other non-OpenCV system, and have the OpenCV system camera adjust to the dimmer light at night when the blue lights turn on.  
What camera specifically could you suggest for this? Thanks.
