convert camera exposure to radiance

Hi,

On page 330 of RwR there is a nice .cal formula that let's you mimic a camera exposure to a .hdr file.
I'd like to do the inverse, and use my camera as an approximate radiance / lux / candela measuring device.
I realize this is pretty approximate, but that will do for now.
Actually, it could have some general usefulness; let's say you visited a beautiful building some time ago took some shots and would like to know the approx. lighting levels there.
Such a tool would be a nice aid.

To go all out on this would be to use the exif data from an image, rather than setting these options manually I suppose.
(That would be pretty easy to do actually)

However, it seems to me that E is returning an exposure setting ( for use with pfilt -e ? ) rather than a Radiance value ( candela, lux conversion could be handy ).
How could I retrieve the approximate radiance value?

Thanks in advance,

-jelle

from __future__ import division
import optparse, math, sys

parser = optparse.OptionParser()
parser.add_option('-e', '--exposure-time', action="store", type=float, help="exposure time")
parser.add_option('-s', '--iso', action="store", type=int, help="film speed (iso/asa)")
parser.add_option('-f', '--f-stop', action="store", type=float, help="camera f-stop")
options, remainder = parser.parse_args()

for i in ['exposure_time', 'f_stop', 'iso']:
    if getattr(options, i) is None:
        print 'the option %s was not set, but is required' % (i)
        sys.exit()

# honestly stolen from Rendering with Radiance page 330
# relationship between Radiance exposure and film exposure

K = 179*(math.pi/200)
# C allows you to ^ on floats and python does not?
E = int( K * options.exposure_time * options.iso / options.f_stop ) ^ 2
sys.stdout.write('E -> ' + str(E) + '\n')

Hi Jelle,

There’s a lot of information available on this topic. You’ll have to go
through different steps to calibrate your camera, define and convert to
the right color space and you’ll need the same picture with several
different exposure times to cover the dynamic range sufficiently
(depending on what you want to use it for). Check out the following:

···

[email protected]http://www.radiance-online.org/mailman/listinfo/radiance-general

Hi Jelle,

If you have access to a Mac, you can download Photosphere to do this for you:

  http://www.anyhere.com

Mehlika Inanici has done some work validating the software:

  http://faculty.washington.edu/inanici/MI-RESEARCH.html

You can subscribe to the hdri mailing list or look at older postings for more information.

Cheers,
-Greg

···

From: Casper Esmeijer <[email protected]>
Date: August 18, 2010 6:32:36 AM PDT

Hi Jelle,

There's a lot of information available on this topic. You'll have to go through different steps to calibrate your camera, define and convert to the right color space and you'll need the same picture with several different exposure times to cover the dynamic range sufficiently (depending on what you want to use it for). Check out the following:
- Paul E. Debevec, Jitendra Malik. “Recovering High Dynamic Range Radiance Maps from Photographs”, Proceedings of SIGGRAPH 97, Computer Graphics Proceedings, Annual Conference Series, pp. 369-378 (August 1997, Los Angeles, California). Addison Wesley. Edited by Turner Whitted. ISBN 0-89791-896-7.
- D. Wueller, H. Gabele,“The Useage of Digital Cameras as Luminance Meters”, SPIE – IS&T Electronic Imaging Conference 2007.
- Karel Fliegel, Josef Havlin, “Imaging photometer with a non-professional digital camera”, Proc. SPIE, Volume 7443, 74431Q, 2009.

This doesn't mean the answer is simple though.

good luck, Casper Esmeijer

jelle feringa schreef:

Hi,

On page 330 of RwR there is a nice .cal formula that let's you mimic a camera exposure to a .hdr file.
I'd like to do the inverse, and use my camera as an approximate radiance / lux / candela measuring device.
I realize this is pretty approximate, but that will do for now.
Actually, it could have some general usefulness; let's say you visited a beautiful building some time ago took some shots and would like to know the approx. lighting levels there.
Such a tool would be a nice aid.

To go all out on this would be to use the exif data from an image, rather than setting these options manually I suppose.
(That would be pretty easy to do actually)

However, it seems to me that E is returning an exposure setting ( for use with pfilt -e ? ) rather than a Radiance value ( candela, lux conversion could be handy ).
How could I retrieve the approximate radiance value?

Thanks in advance,

-jelle

from __future__ import division
import optparse, math, sys

parser = optparse.OptionParser()
parser.add_option('-e', '--exposure-time', action="store", type=float, help="exposure time")
parser.add_option('-s', '--iso', action="store", type=int, help="film speed (iso/asa)")
parser.add_option('-f', '--f-stop', action="store", type=float, help="camera f-stop")
options, remainder = parser.parse_args()

for i in ['exposure_time', 'f_stop', 'iso']:
    if getattr(options, i) is None:
        print 'the option %s was not set, but is required' % (i)
        sys.exit()

# honestly stolen from Rendering with Radiance page 330
# relationship between Radiance exposure and film exposure

K = 179*(math.pi/200)
# C allows you to ^ on floats and python does not?
E = int( K * options.exposure_time * options.iso / options.f_stop ) ^ 2
sys.stdout.write('E -> ' + str(E) + '\n')

See Kodak's "Estimating Luminance and Illuminance With Reflection-Type Exposure Meters and an 18% Neutral Test Card" at <http://www.kodak.com/cluster/global/en/consumer/products/techInfo/am105/am105kic.pdf>

Since

modern digital cameras record their exposures, the gray card is unnecessary, and the calculation can be automated, as Greg has done in Photosphere. One thing to keep in mind is that a camera exposure calculation may use different spectral weights than a luminance meter.

Randolph

···

On 2010-08-18 04:07:52 -0700, jelle feringa said:

I'd like to do the inverse, and use my camera as an approximate radiance / lux / candela measuring device.
I realize this is pretty approximate, but that will do for now.

Just as a note, I would always recommend to

1) Get your hands on some known light source for calibration (knowing someone with an integrating sphere may be an advantage).

2) Find out how to lock everything in your camera - it is annoying to find out about all these automatic features that affect the jpgs which end up on a memory card. Do not forget white balance and all that.

Cheers, Lars.

Even the automatic features like image enhancement and the like won't ruin
your HDR efforts as long as you keep things consistent. You want to fix
everything you can:

Aperture
White balance
ISO, etc.

Jelle, definitely check out the HDR mailing list hosted on this site for
loads of good info.

···

On 8/19/10 4:28 AM, "Lars O. Grobe" <[email protected]> wrote:

Just as a note, I would always recommend to

1) Get your hands on some known light source for calibration (knowing
someone with an integrating sphere may be an advantage).

2) Find out how to lock everything in your camera - it is annoying to
find out about all these automatic features that affect the jpgs which
end up on a memory card. Do not forget white balance and all that.

Cheers, Lars.