Thursday, February 25, 2021

Timing Is Everything

Background: My TomatoCam project uses an Raspberry Pi 4 to control a USB camera. The goal is to create a time-lapse video of our tomato plants as they grow. 

The Story So Far: I can't seem to get the settings right. I thought I had it worked out and started taking photos once a day, but they were terrible as the camera's automatic image control was whacked.

A Discovery?

The USB camera is a cheap one designed to connect to a cameraless computer for video conferencing. It's not designed to take photos even though it has the internal software interface for it. I believe I've discovered the problem and it kind of makes sense.

The camera's sequence seems to be this.

  1. Take photo.
  2. Use that photo to adjust brightness and saturation levels.
  3. Take another photo.

That means that the initial photo will use the settings from the previous photo. If that photo was taken at night, it will be blown out. If it was taken in the brightness of day, it will be dark. I can adjust the settings manually through a programming interface, but even these seem to take effect after a photo has been shot. Dig this.

Auto exposure turned off.

Auto exposure turned on before this shot.

Auto exposure takes effect.

Auto exposure on, 10 AM shot. This one works for me.

I think I'll go back to my 1100 daily schedule, but take a preliminary photo and throw it away. That should force the camera to make its adjustments before taking the one I want.

The sad part is that each experiment takes a day to run. Waiting around is the worst!

No comments: