Optimal Settings - Outdoor Frame Differencing

I am learning my way in image processing by developing a frame difference program for an outdoor application using Grayscale. I have spent some time searching the forum but could not find a post specific to me question.

Basically, what are the optimal settings for:

  1. Exposure? (auto …)

  2. Gain control.

  3. Grayscale Threshold values? How to decide?

Also, in an outdoor application, the scene will change continiously with time due to different lighting (day to night, cloudy to sunny …etc.). How does frame differencing handle that?

Your help is appreciated and thanks in advance.

There’s not really an optimal settings sure approach for this. You basically will need to collect data and then develope your own algorithm for how to do this. It’s very labor intensive and is going to take you a lot of time and testing. You can use the get_stats() method to automate changing camera settings based on how the image looks. The best thing would be to assume the image should not be blown out and decrease the exposure until it’s not overly white and increase the exposure if the image is too dark. For threshold values, those shouldn’t need to change too much. However, you’ll want to have some smart filter than always blends image changes overtime into the background frame buffer so you don’t trigger forever.

Thank you fr your help and prompt answer.

I suggest optimizing one system at a time. First get exposure control working over the course of a day. As for gain control I recommend to just make that low and not to have a lot of gain. Gain in the image just causes noise in the picture making your job harder. I’d turn off auto gain control and set it to a static low db value.

Anyway, once you’ve made the image look good all the time then add the frame differencing part back in.

So, in summary make the image look good first over the course of the day.

Note, I recommend using the latest firmware version. I put out some changes to OV7725 driver that make the images look a lot better.

Thank you. I will follow your recommendations.