应对灰度模板匹配中的亮度
我正在使用 opencv 进行实时模板匹配。相机可生成 52 fps 的灰度图像。该软件工作正常,但有时由于光线条件不好而导致匹配失败。
相机不提供调整亮度的方法(它只是自动调整)。事实证明,有时图像要么太暗,要么太亮,模板匹配失败。
你会如何应对这个问题?有办法让它发挥作用吗?
谢谢。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您在相机的动态范围内,请在匹配之前标准化亮度。有多种技术可以做到这一点,但通常来说,累积整个图像的亮度并按固定因子调整每个像素就足够了。
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.