Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

How to identify colour of a LED?

Hello,

 

I am using Vision Builder 2012 for identifying colours of LEDs. I have created .vbai which first acquires an image. Then there are few LEDs which colours are green, red and yellow. I have added measure colours step for each LED. What could be the best way to test that a LED has correct colour? Should I use RGB as the color space? I am passing numeric results to LabVIEW which performs the test itself. In Labview I parse Numeric Measurement out from the Step Results VBAI Interface - Get Inspection result.vi. Is there colour spesific values of each colour?

Is there any other way to do this?

BR,
Jick

0 Kudos
Message 1 of 5
(5,374 Views)

Instead of using RGB color space, I would use HSL. Then you can just look at the Hue value to determine the color. The HSL color space is more resistant to lighting changes and you can get the color in a single value instead of having to take into account all three color plane values like you do with RGB. Once you haver the Hue value, you can check if it's in range for the various colors. It's important to note that red wraps around so it might cover ranges from 240-255 and from 0- 20 or so.

 

Hope this helps,

Brad

Message 2 of 5
(5,369 Views)

This might be a good idea. Thanks.

Additionally I need to analyze a LED which is switched off (black/dark ROI). I am wondering if it can also be analyzed using hue avg value or should I measure for example intensity instead of it? Using hue avg gives something aroung 200 but is it reliable measurement?

BR,
Jick

0 Kudos
Message 3 of 5
(5,337 Views)

Hue is good for measuring color. If you want to measure how might/dim something is, use Intensity, it will give you a better differentiation between on/off.

Message 4 of 5
(5,326 Views)

Hi Jick.

Brad is right. If your LED is dark, you will typically measure noise on the hue channel. Avoid this by first checking the intensity. If intensity is low, do not expect the hue value to be that precise.

0 Kudos
Message 5 of 5
(5,315 Views)