<< return to Pixycam.com

Outdoor lighting compatibility?

I am planning on using the pixy2 for an outdoor application where the lighting could either be extremely bright or pitch black. Of course, with this large variation in lighting, the pixycam wouldn’t work for object tracking without a bit of help.

I am thinking of having a few LEDs (same orientation as the onboard LEDs) and a photoresistor (“looking” in the same direction as the camera) to try and always maintain the same brightness. I am not using the onboard LEDs because I can only turn them on or off, not control brightness. With this method, I would add a new color signature in a very bright condition since I can make the environment brighter, but not dimmer.

I don’t think this is necessarily the best approach to this, so has anyone else had experience with using the pixycam in a large variety of lighting conditions? How did you overcome the issue?

Thanks!

Hello,
This is challenging. What you want is the ability to read and write a color signature (save and load) so you can have separate signatures for different lighting conditions, assuming that you know which condition you’re in. You can do this currently in PixyMon by saving/loading parameters. If you don’t mind doing that, it could be a good solution. Doing this from your Arduino (for example) over serial would probably be what you want though. We should consider this as a future firmware feature.

If you are trying to detect a yellow object (for example), you could train signature 1 on the object in one lighting condition and signature 2 in another lighting condition. This might work somewhat, but similar signatures tend to “step on each other”, making signature 2 inherit all the parts that signature 1 doesn’t already have. Signature 2 ends up being “weak”. But if the lighting is sufficiently different (different color temperatures) this approach might work well for you.

Hope this helps!

Edward

Interesting approach - I tried to add different signatures for different times of the day, but it doesn’t seem to be too consistent. I think with the combination of varying brightness and color temperature, there are just far too many potential combinations. So here are my thoughts on that:

First thing to tackle is brightness

Going back to my original thought, I have made a few changes to the original setup. Instead of a photoresistor, I am using an Adafruit TSL2561 (digital light sensor) and super bright white COB LED with a relatively neutral color temperature. I can vary the brightness of the LED using PWM and a mosfet to match the same brightness as when the color signature was calibrated. The challenge with this now is that the light ends up being too harsh, so I am going to work on diffusing the LED a bit.

Next I have to fix the color temperature issue.

I believe you discussed this in a previous forum post. I haven’t tried it yet, but I will try the “press the button for while balance” method. Since I want to eventually make this automated, I will connect a digital pin to the button to let the Arduino control it (I’ll of course check what logic level it is running at, if it is active high/low, etc). I haven’t tested this bit yet. I could also just reset the Pixy’s power by splicing into the ribbon cable or just individually connecting each pin or something (not important at the moment).

I think the order of operations would be something like:

  1. Arduino determines camera has to be used (determined by another part of the project)
  2. Arduino reads light sensor and adjusts LED to match brightness
  3. Arduino makes Pixy auto-white balance
  4. Pixy does it’s magic :slight_smile:

Please let me know if this is logical or if I am completely missing the point on how this works! Thanks!

Hello,
If your Pixy is going to be in the same place where it’s likely to see consistent lighting temps, you should consider disabling “auto white balance on power-up and auto white balance”

https://docs.pixycam.com/wiki/doku.php?id=wiki:v2:pixymon_index#camera-tab

By disabling these, Pixy will keep the color temp gains between power cycles, so your color signatures will remain more consistent.

Your ideas about adjusting brightness and color temperature are interesting :slight_smile: I haven’t tried this kind of approach. I’ve found these issues to be difficult remedy… I’d try the simplest approaches first — like disabling all auto white balance settings and see how far you can get. It’s possible that you can expend lots of effort on the brightness and color temp issue without much improvement. :frowning:

Another approach, which is pretty lame actually, is to have 2 Pixys: one for each lighting condition. This will likely give you good results with not too much effort (just a little extra cost.)

Hope this helps!

Edward

Hello,

Yup, the Pixy will be in the same place. Unfortunately, this is something that I would be running 24/7/365, so there will be a very large variation in brightness throughout the day and variation in color temperature between months. I will still give your method a try and update on the results!

Thanks!