Question

I am using opencv for real-time template matching. The camera yields at 52fps grayscale images. The software works just fine but sometimes the matching fails because of bad light condition.

The camera doesn't provide a way to adjust the brightness (it simply adjusts it automatically). It turns out that sometimes the image is either too dark or too light and the template matching fails.

How would you cope with this? Is there a way to make it working?

Thanks.

Était-ce utile?

La solution

If you are within the dynamic range of your camera, normalize the brightness before matching. There is a number of techniques to do this, but quite often it is sufficient to accumulate the brightness over the whole image and adjust every pixel by a fixed factor.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top