简体   繁体   English

使用opencv和C ++识别并更改亮度和对比度,使其适用于图像处理

[英]Identify and Change brightness and contrast so it is suitable for image processing, using opencv and C++

I want to do image processing using OpenCV and C++. 我想用OpenCV和C ++进行图像处理。 When I am capturing an image in a dark environment it seems to be hard to do people detection. 当我在黑暗的环境中拍摄图像时,似乎很难进行人物检测。 Changing brightness and contrast may help the situation. 改变亮度和对比度可能有助于这种情况。 But my project is related with computer vision. 但我的项目与计算机视觉有关。 So i want my program to identify weather there is a need of adding or reducing brightness and contrast, But how to identify that? 所以我希望我的程序识别天气,需要增加或减少亮度和对比度,但如何识别呢? I have no idea, Please help 我不知道,请帮忙

Good solution: Use illumination so your scene is not dark. 好的解决方案:使用照明使您的场景不暗。

If this is not possible you can increase exposure time and/or gain. 如果无法做到这一点,您可以增加曝光时间和/或增益。 Both methods degrade your SNR. 这两种方法都会降低您的SNR。 Especially with moving people motion blur will become a problem if your exposure time is too high. 特别是对于移动的人来说,如果曝光时间太长,运动模糊将成为一个问题。

Do not just increase image brightness or contrast by software. 不要只是通过软件增加图像亮度或对比度。 It makes no difference for your computer, only for you. 它对您的计算机没有任何影响,仅适用于您。

Read something about auto exposure algorithms. 阅读有关自动曝光算法的内容。 A well exposed image is neither under nor over exposed. 曝光良好的图像既不曝光也不曝光。 It's histogram should be as broad as possible. 它的直方图应该尽可能宽。

I believe, You can try "histogram equalization" . 我相信,你可以尝试“直方图均衡”。 Here is an example image that i have used for experiment. 这是我用于实验的示例图像。

Example

Source code in C++ language C ++语言的源代码

Please let me know if you need any more information regarding this topic. 如果您需要有关此主题的更多信息,请与我们联系。

I think you should consider using an infrared camera. 我认为你应该考虑使用红外热像仪。 See this article here for example: "Selection of a Visible-Light vs. Thermal Infrared Sensor in Dynamic Environments Based on Confidence Measures", authors: Cuerda and coworkoers. 例如,这里参见这篇文章:“基于置信度测量在动态环境中选择可见光与热红外传感器”,作者:Cuerda和同事。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM