Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Great question!

You may want to take a look at the hueDistance and findBlobs methods. The findBlobsFromPallete method could also help (note that you should update from the github develop branch as this method was recently updated). Another helpful tool is the Color class. The color class has a few methods that can help you switch between rgb colors and hues (although it isn't perfect). With bright enough illumination all colors of light look the same (that is to say white, as they saturate all the sensor channels). The area around the light where it refracts is actually where you are going to pick up the most color difference. You may also want to lower you camera's gain and or turn down the exposure.

My guess is that you may want to turn this into a two step process. First look for the brightest, whitest area in the scene, and then filter it on shape and size. This should give you an estimate of the light location. Once you have that you can look at the average color around that region to see if it skews red or green.

Let us know if you need more help.