Yahia Farghaly
Yahia Farghaly

Reputation: 897

Measure luminance of the light from a camera

Can I detect the intensity or the amount of light in a picture ?

For example,

I have some pictures which are captured at morning ,afternoon and the time before the sunset and i want to know the amount of the light.

I just need an idea of how to do it. Also I have an access to the camera gain, exposure and other parameters. The camera which I am using is the ZED Camera. I understand the formula which convert from RGB space to luminance space as stated here. But I'm not sure if it's an efficient solution or not.

Upvotes: 1

Views: 5197

Answers (3)

Mark Setchell
Mark Setchell

Reputation: 208013

You seem not to be answering my question in the comments section for some reason, so I am not sure what you are trying to do, but it seems to be along the lines of determining the general brightness of the sky or somesuch.

So, firstly, you need to determine the average brightness/lightness within your image. For this step, you can convert to Lab or HSL colourspace using cvtColor() and then get the mean value of the L channel over the entire image using mean() or meanStdDev().

Now, and I guess this is what your question is actually about, you need to correct for the exposure since the exposure may vary between two images. So, the three things that affect exposure are ISO (a.k.a. film sensitivity), lens aperture and length of exposure.

Basically, every f-stop of aperture change represents a halving or doubling of the area of the lens aperture and therefore a doubling or halving of the amount of light that hits the sensor. So, f4 lets in 2x the light of f5.6, and that lets in twice the light of f8 and so on. Notice that each full stop of light differs from the next by sqrt(2).

Likewise with ISO, each time the ISO doubles (or the sensitivity doubles) the amount of light doubles.

Likewise with the time of the exposure, 1/2 a second is twice as long as a quarter of second.

So, basically, you have your mean Lightness value and you need to correct that for aperture, for ISO and exposure duration. In effect, you must normalise your images to a standard aperture, ISO and exposure time. Every stop different your image is from your normal, you must double or halve the mean Lightness. Every ISO step your image differs from your normal image by, you must double or halve the mean Lightness. Every time your exposure duration is different from your standardised, normalised duration, you must multiply your average mean Lightness by the ratio of the current image to your normalised image.

Then your mean lightnesses will be comparable with one another.

(Filters will also affect exposure, but I presume you are not adding or removing filters between exposures.)


In answer to your comment, I have never seen anyone write a formula as such, but my comments amount to this:

L * 2^aperture
--------------
ISO * time

Upvotes: 2

chloelle
chloelle

Reputation: 342

All you can hope to measure with your camera and some images is the relative luminance. Even if you have the camera settings. https://en.wikipedia.org/wiki/Relative_luminance

If you want to know the amount of light in absolute radiometric units, you're going to need to use some kind of absolute light meter or measured light source to calibrate your camera. For references on how to do this, see: Section 2.5 Obtaining Absolute Radiance from http://www.pauldebevec.com/Research/HDR/debevec-siggraph97.pdf

Upvotes: 1

Jeru Luke
Jeru Luke

Reputation: 21233

In order to measure the luminance of an image, I would suggest working with the LAB color space. The L channel (light) represents the amount of light present in the image.

Few merits:

  1. Since the L channel deals with the light intensity of the image, modifying it enhances the image.
  2. Research studies also say that the L channel closely resembles the way we humans perceive light intensity in the real world.

Upvotes: 2

Related Questions