<< return to Pixycam.com

AGC and color recognition

Pixy adjusts the brightness automatically based on some kind of averaging. There is a side effect that affects color recognition. If trained on a scene with a dark background the same colors will not be recognized against a light background. (or even foreground) Here is a video file that illustrates the problem.

http://www.wa4dsy.net/Files/pixy-color.m4v

How would a mobile robot that will encounter many different lighting situations get around this issue?

Measuring incident light with a upward facing photocell for agc might work but the hardware doesn’t have one.

Hi Dale,
So Pixy only uses hue and saturation to find objects (not brightness), so Pixy is automatically fairly decent at dealing with different lighting and exposure changes (like what you describe). But still, lighting and exposure changes can affect the saturation, and things will break, like in your video. (Low light and low exposure results in lower saturation values.)

When Pixy creates a signature, it automatically calculates a range of saturations it expects based on the training set. When training on very uniform swatches (like you have in your video) Pixy will tend to create a fairly small saturation range. This needs to be improved…because it isn’t usually what’s wanted/needed.

But you can fix this by playing with the “Min saturation” and “Saturation spread” parameters. In particular, try increasing “Saturation spread” – it’s a multiplier, try 10.0 and see if that improves things. You might also try lowering “Min saturation”… bear in mind that these parameters only affect signature generation, so change the values and re-teach.

This link contains similar info, perhaps goes into a little more detail:
http://cmucam.org/projects/cmucam5/wiki/Some_Tips_on_Generating_Color_Signatures

Thanks for the saturation spread tip. Changing it from 1 to 10 made a dramatic improvement. I can even move the color paper targets from the gray carpet to white tile floor and it still works!

Wow Rich!!

That makes a HUGE difference in detection. It has greatly eliminated false “Hue Artifacts”

Thanks!!!