Camera RGB LED Colour detecting as white (CAM Detecting LED too bright, even with a diffusion material inbetween)


So I’m currently working with the OpenMV H7 R2 Camera. I’ve set up the camera to detect 4 LEDs (RED, GREEN, BLUE and BLUE). The reason I am using specifically coloured LEDs is so that the camera is able to ID each one and keep track of which LED is which, then send the cx and cy locations of each LED to my PC to go through an algorithm.

The LEDs are quite bright and the camera is detecting the centre of the LEDs as white instead of the actual colour of the LED. I also tried adding a diffusing material in between to reduce the brightness of the LED (cut a table tennis ball in half and then put them on-top of the LEDs) but it still detects the diffusing material as mostly white. The table tennis balls also look very blue/green/red when looking at them…

Is there maybe a setting in the OpenMV software that can make the camera detect the LEDs as the correct colour instead of white?

Hi, you need to turn off white balance before you start color tracking as the camera will try to change the color distributions to make the image look grey.

A picture of the object from the camera would help.


Sorry about the delayed response, I was only able to return to this project today. Here’s the images of camera and the code that I used to generate it. The code is the example ‘multi_colour_blob_tracking’. I have adapted most of my code from your blob detection examples (grayscale) but I am trying to also implement colour tracking so that I can ID each blob. (sensor.set_auto_whitebal is set to false) -

I do not have the half a table tennis ball on me right now, but it basically just detects the table tennis ball as white everywhere except for the edges. I’ll see if I can cut another table tennis ball and send another image.

[Edit] - I’ve cut up the table tennis ball and captured another image with it covering the LEDs. Here is the image (only covered 2 out of 4 of the LEDs, right side):

hi there!
cant you see that the leds are too btight?
Did you try to set manual exposure and dind’t help?

Hi, the LEDs are very bright hence why I tried adding a diffusing material in between (Table Tennis balls). I could decrease the brightness by adding an extra resistor but I’d prefer to try fix the problem with code first (as adding an extra resistor will be quite a bit of work compared to changing a few lines of code). I haven’t tried setting manual exposure, could it help? If so how would I set that?

sensor.set_auto_exposure(enable [, exposure_us ])

enable turns auto exposure control on (True) or off (False). The camera will startup with auto exposure control on.

If enable is False you may set a fixed exposure time in microseconds with exposure_us.


Camera auto exposure algorithms are pretty conservative about how much they adjust the exposure value by and will generally avoid changing the exposure value by much. Instead, they change the gain value alot of deal with changing lighting.

1 Like

Yeah, you are just hitting the limit of the dynamic range of the camera. You need to reduce the exposure and gain on the camera sensor.

1 Like