rockstone533
rockstone533

Reputation: 21

Calculate the perceived brightness of an image

I wanna calculate the perceived brightness of an image and classify the image into dark, neutral and bright. And I find one problem here! And I quote Lakshmi Narayanan's comment below. I'm confused with this method. What does "the average of the hist values from 0th channel" mean here? the 0th channel refer to gray image or value channel in hsv image? Moreover, what's the theory of that method?

Well, for such a case, I think the hsv would be better. Or try this method @2vision2. Compute the laplacian of the gray scale of the image. obtain the max value using minMacLoc. call it maxval. Estimate your sharpness/brightness index as - (maxval * average V channel values) / (average of the hist values from 0th channel), as said above. This would give you certain values. low bright images are usually below 30. 30 - 50 can b taken as ok images. and above 50 as bright images.

Upvotes: 2

Views: 4295

Answers (1)

Piglet
Piglet

Reputation: 28950

If you have an RGB color image you can get the brightness by converting it to another color space that separates color from intensity information like HSV or LAB.

Gray images already show local "brightness" so no conversion is necessary.

If an image is perceived as bright depends on many things. Mainly your display device, reference images, contrast, human...

Using a few intensity statistics values should give you an ok classification for one particular display device.

Upvotes: 1

Related Questions