简体   繁体   中英

Get brightness and contrast of an image in opencv python

I am trying to do some image processing in python3.7 using openCV 4+. I need to add a filter where it checks for the brightness of the input image/frame(if video) and then decides whether to change brightness or not. Can some one help me how do I get the brightness of the current image? Thank you in advance

There is no "brightness" absolute value stored in images. Whereas, you can compute the mean of the image luminance, and consider it to be the 0 brightness to enable the user to add/remove brightness, or calculate the difference between this mean and the wanted one, to adjust it.

You can refer to this post .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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