Aayush Lakkad
Aayush Lakkad

Reputation: 97

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

Upvotes: 0

Views: 3265

Answers (1)

totok
totok

Reputation: 1500

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.

Upvotes: 1

Related Questions