[Radiance-general] convert camera exposure to radiance

jelle feringa jelleferinga at gmail.com
Wed Aug 18 04:07:52 PDT 2010


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')
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://radiance-online.org/pipermail/radiance-general/attachments/20100818/a12971b0/attachment.htm


More information about the Radiance-general mailing list