HDRI capture of LED

Dear All,

I would like to make use of Greg's script, but had a problem. It seems that either my search path for the exiftool is not checking the local directory, or I have to copy exiftool to the right directory, or update perl, but I'm not sure. My input and output is shown below. The error at the bottom of the snippet repeats for each image. Any advice?

Also, is there a good reason for me to create my own calibration file for my camera? Or is it safe to use the built-in calibration data for my camera?

Thanks!
Chris

GRad:~ chris$ cd Thesis/BangFilt/WardMethod/raw/B1
GRad:B1 chris$ ls
Img1310.NEF Img1312.NEF Img1314.NEF Img1316.NEF Img1318.NEF dcraw hdrgen
Img1311.NEF Img1313.NEF Img1315.NEF Img1317.NEF Img1319.NEF exiftool raw2hdr
GRad:B1 chris$ raw2hdr -o B1.hdr *.NEF
Loading NIKON D90 image from Img1310.NEF ...
Scaling with darkness 0, saturation 3840, and
multipliers 2.170906 1.000000 1.163172 1.000000
AHD interpolation...
Converting to sRGB colorspace...
Writing data to standard output ...
Can't locate Image/ExifTool.pm in @INC (@INC contains: ./lib /Library/Perl/Updates/5.10.0 /System/Library/Perl/5.10.0/darwin-thread-multi-2level /System/Library/Perl/5.10.0 /Library/Perl/5.10.0/darwin-thread-multi-2level /Library/Perl/5.10.0 /Network/Library/Perl/5.10.0/darwin-thread-multi-2level /Network/Library/Perl/5.10.0 /Network/Library/Perl /System/Library/Perl/Extras/5.10.0/darwin-thread-multi-2level /System/Library/Perl/Extras/5.10.0 .) at ./exiftool line 30.
BEGIN failed--compilation aborted at ./exiftool line 30.

···

On 2/20/12 12:10 PM, Gregory J. Ward wrote:

Photosphere does not accept camera RAW as input, but I have written a Perl script that uses dcraw with the command-line HDR image builder hdrgen to overcome this limitation. It also requires the use of another third-party program, exiftool, which I have packaged together for you at:

http://www.anyhere.com/gward/pickup/raw2hdr.tgz

I goofed with the posted script. You need to download and install Exiftool yourself from:

  http://www.sno.phy.queensu.ca/~phil/exiftool/install.html

I think I mentioned this in a follow-up post. Once you have that, the script should at least urn.

-Greg

···

From: Chris Kallie <[email protected]>
Date: March 7, 2012 2:16:45 PM PST

Dear All,

I would like to make use of Greg's script, but had a problem. It seems that either my search path for the exiftool is not checking the local directory, or I have to copy exiftool to the right directory, or update perl, but I'm not sure. My input and output is shown below. The error at the bottom of the snippet repeats for each image. Any advice?

Also, is there a good reason for me to create my own calibration file for my camera? Or is it safe to use the built-in calibration data for my camera?

Thanks!
Chris

GRad:~ chris$ cd Thesis/BangFilt/WardMethod/raw/B1
GRad:B1 chris$ ls
Img1310.NEF Img1312.NEF Img1314.NEF Img1316.NEF Img1318.NEF dcraw hdrgen
Img1311.NEF Img1313.NEF Img1315.NEF Img1317.NEF Img1319.NEF exiftool raw2hdr
GRad:B1 chris$ raw2hdr -o B1.hdr *.NEF
Loading NIKON D90 image from Img1310.NEF ...
Scaling with darkness 0, saturation 3840, and
multipliers 2.170906 1.000000 1.163172 1.000000
AHD interpolation...
Converting to sRGB colorspace...
Writing data to standard output ...
Can't locate Image/ExifTool.pm in @INC (@INC contains: ./lib /Library/Perl/Updates/5.10.0 /System/Library/Perl/5.10.0/darwin-thread-multi-2level /System/Library/Perl/5.10.0 /Library/Perl/5.10.0/darwin-thread-multi-2level /Library/Perl/5.10.0 /Network/Library/Perl/5.10.0/darwin-thread-multi-2level /Network/Library/Perl/5.10.0 /Network/Library/Perl /System/Library/Perl/Extras/5.10.0/darwin-thread-multi-2level /System/Library/Perl/Extras/5.10.0 .) at ./exiftool line 30.
BEGIN failed--compilation aborted at ./exiftool line 30.

On 2/20/12 12:10 PM, Gregory J. Ward wrote:

Photosphere does not accept camera RAW as input, but I have written a Perl script that uses dcraw with the command-line HDR image builder hdrgen to overcome this limitation. It also requires the use of another third-party program, exiftool, which I have packaged together for you at:

http://www.anyhere.com/gward/pickup/raw2hdr.tgz

Thanks Greg! I am getting closer... Can I bother anyone with a few more questions?

1) My first attempt after installing the Unix version of exiftool showed this output near the end:

>raw2hdr -o B1.hdr *.NEF
.
Loading NIKON D90 image from Img1319.NEF ...
Scaling with darkness 0, saturation 3840, and
multipliers 2.170906 1.000000 1.163172 1.000000
AHD interpolation...
Converting to sRGB colorspace...
Writing data to standard output ...
     1 image files updated
Executing: hdrgen -m 400 -e -a -r /tmp/raw2hdr.vVpbvN/sqr.rsp -o B1.hdr -c sRGB /tmp/raw2hdr.vVpbvN/Img1310.tif /tmp/raw2hdr.vVpbvN/Img1311.tif /tmp/raw2hdr.vVpbvN/Img1312.tif /tmp/raw2hdr.vVpbvN/Img1313.tif /tmp/raw2hdr.vVpbvN/Img1314.tif /tmp/raw2hdr.vVpbvN/Img1315.tif /tmp/raw2hdr.vVpbvN/Img1316.tif /tmp/raw2hdr.vVpbvN/Img1317.tif /tmp/raw2hdr.vVpbvN/Img1318.tif /tmp/raw2hdr.vVpbvN/Img1319.tif
phdrimg.cpp@564>data: /tmp/raw2hdr.vVpbvN/Img1310.tif: needs exposure calibration
hdrgenmain.cpp@185>data: Failure generating HDR image

2) I then dug up an old response file, and tried a few different permutations of the following:

>raw2hdr hdrgen -r cama.rsp -o output.hdr *.NEF
>raw2hdr -r cama.rsp -o output.hdr *.NEF
>...etc..

However, I got different errors with different command orderings. I am sure I have a syntax/command order problem, but I am also worried that if/when I get it right, there will be another problem... The cama.rsp file I have was made from jpegs. I may have to remake this with .NEFs, but I am not sure how to get a .rsp file from .NEFs. Any suggestions?

3) Finally, I have a lot of Radiance/Photosphere/hdrgen creators and software to credit in my work. Is there a documented list for proper software references, or should I do my best by examining the literature?

Thanks again!
-Chris

···

On 3/7/12 4:50 PM, Gregory J. Ward wrote:

I goofed with the posted script. You need to download and install Exiftool yourself from:

http://www.sno.phy.queensu.ca/~phil/exiftool/install.html <http://www.sno.phy.queensu.ca/~phil/exiftool/install.html&gt;

I think I mentioned this in a follow-up post. Once you have that, the script should at least urn.

-Greg

*From: *Chris Kallie <[email protected] <mailto:[email protected]>>

*Date: *March 7, 2012 2:16:45 PM PST

*

Dear All,

I would like to make use of Greg's script, but had a problem. It seems that either my search path for the exiftool is not checking the local directory, or I have to copy exiftool to the right directory, or update perl, but I'm not sure. My input and output is shown below. The error at the bottom of the snippet repeats for each image. Any advice?

Also, is there a good reason for me to create my own calibration file for my camera? Or is it safe to use the built-in calibration data for my camera?

Thanks!
Chris

GRad:~ chris$ cd Thesis/BangFilt/WardMethod/raw/B1
GRad:B1 chris$ ls
Img1310.NEF Img1312.NEF Img1314.NEF Img1316.NEF Img1318.NEF dcraw hdrgen
Img1311.NEF Img1313.NEF Img1315.NEF Img1317.NEF Img1319.NEF exiftool raw2hdr
GRad:B1 chris$ raw2hdr -o B1.hdr *.NEF
Loading NIKON D90 image from Img1310.NEF ...
Scaling with darkness 0, saturation 3840, and
multipliers 2.170906 1.000000 1.163172 1.000000
AHD interpolation...
Converting to sRGB colorspace...
Writing data to standard output ...
Can't locate Image/ExifTool.pm in @INC (@INC contains: ./lib /Library/Perl/Updates/5.10.0 /System/Library/Perl/5.10.0/darwin-thread-multi-2level /System/Library/Perl/5.10.0 /Library/Perl/5.10.0/darwin-thread-multi-2level /Library/Perl/5.10.0 /Network/Library/Perl/5.10.0/darwin-thread-multi-2level /Network/Library/Perl/5.10.0 /Network/Library/Perl /System/Library/Perl/Extras/5.10.0/darwin-thread-multi-2level /System/Library/Perl/Extras/5.10.0 .) at ./exiftool line 30.
BEGIN failed--compilation aborted at ./exiftool line 30.

On 2/20/12 12:10 PM, Gregory J. Ward wrote:

Photosphere does not accept camera RAW as input, but I have written a Perl script that uses dcraw with the command-line HDR image builder hdrgen to overcome this limitation. It also requires the use of another third-party program, exiftool, which I have packaged together for you at:

http://www.anyhere.com/gward/pickup/raw2hdr.tgz

_______________________________________________
HDRI mailing list
[email protected]
http://www.radiance-online.org/mailman/listinfo/hdri

Hi Chris,

Unfortunately, it seems that either the version of Exiftool you got isn't working right, or the input images are missing information. You should send me a copy of one of your NEF input images in a private message and I'll have a look at it.

Using a different response function will not solve the problem.

I have not written any papers on Photosphere or hdrgen. You'll just have to refer to the anyhere.com website, I'm afraid.

Best,
-Greg

···

From: Chris Kallie <[email protected]>
Date: March 7, 2012 7:53:21 PM PST

Thanks Greg! I am getting closer... Can I bother anyone with a few more questions?

1) My first attempt after installing the Unix version of exiftool showed this output near the end:

>raw2hdr -o B1.hdr *.NEF
.
.
.
Loading NIKON D90 image from Img1319.NEF ...
Scaling with darkness 0, saturation 3840, and
multipliers 2.170906 1.000000 1.163172 1.000000
AHD interpolation...
Converting to sRGB colorspace...
Writing data to standard output ...
    1 image files updated
Executing: hdrgen -m 400 -e -a -r /tmp/raw2hdr.vVpbvN/sqr.rsp -o B1.hdr -c sRGB /tmp/raw2hdr.vVpbvN/Img1310.tif /tmp/raw2hdr.vVpbvN/Img1311.tif /tmp/raw2hdr.vVpbvN/Img1312.tif /tmp/raw2hdr.vVpbvN/Img1313.tif /tmp/raw2hdr.vVpbvN/Img1314.tif /tmp/raw2hdr.vVpbvN/Img1315.tif /tmp/raw2hdr.vVpbvN/Img1316.tif /tmp/raw2hdr.vVpbvN/Img1317.tif /tmp/raw2hdr.vVpbvN/Img1318.tif /tmp/raw2hdr.vVpbvN/Img1319.tif
phdrimg.cpp@564>data: /tmp/raw2hdr.vVpbvN/Img1310.tif: needs exposure calibration
hdrgenmain.cpp@185>data: Failure generating HDR image

2) I then dug up an old response file, and tried a few different permutations of the following:

>raw2hdr hdrgen -r cama.rsp -o output.hdr *.NEF
>raw2hdr -r cama.rsp -o output.hdr *.NEF
>...etc..

However, I got different errors with different command orderings. I am sure I have a syntax/command order problem, but I am also worried that if/when I get it right, there will be another problem... The cama.rsp file I have was made from jpegs. I may have to remake this with .NEFs, but I am not sure how to get a .rsp file from .NEFs. Any suggestions?

3) Finally, I have a lot of Radiance/Photosphere/hdrgen creators and software to credit in my work. Is there a documented list for proper software references, or should I do my best by examining the literature?

Thanks again!
-Chris

Problem solved....

···

From: Chris Kallie <[email protected]>
Date: March 7, 2012 8:55:44 PM PST

Hi Greg,

You are right about ISO 200 on the D90, and adding -ISO to the script worked! Thanks a million!!!

-Chris

On 3/7/12 10:40 PM, Gregory J. Ward wrote:

Hi Chris,

Your image was shot with a Nikon D90 with an "extended ISO" setting of 100. This messes up dcraw a bit and it doesn't store the ISO value in the usual way. You can avoid this problem by shooting with ISO 200, which is the lowest native sensor gain on the D90, or (I believe) by adding -ISO to the @exiftags setting near the top of the raw2hdr script.

Try it!

-Greg

From: Chris Kallie <[email protected]>
Date: March 7, 2012 8:15:34 PM PST

Hi Greg,

Attached is an image of a Bangerter filter with the camera pointed at a makeshift delta function. We are essentially digitizing a physical filter to convolve with regular camera and radiance hdr images. So far it has been working well, but with the recent LED discussion, I thought I'd try to improve the accuracy of the model...

Thanks for all your help! I am amazed at your dedication and responsiveness!
-Chris

On 3/7/12 10:05 PM, Gregory J. Ward wrote:

Hi Chris,

Unfortunately, it seems that either the version of Exiftool you got isn't working right, or the input images are missing information. You should send me a copy of one of your NEF input images in a private message and I'll have a look at it.

Using a different response function will not solve the problem.

I have not written any papers on Photosphere or hdrgen. You'll just have to refer to the anyhere.com website, I'm afraid.

Best,
-Greg

Hello everybody!

I’ll provide the summary of my research and have questions within the
summary.I would appreciate any of your help!

My research investigates if HDRI technique can precisely capture
luminances of small bright light sources (e.g. LED garage fixtures) with narrow
light distributions.

I was able to figure out luminance values for a single LED, which can be
compared to the ones from HDR images. But I have a couple of questions/concerns on HDRI technique and Photosphere.

At first, I’ve used “regular” scene to retrieve response
curve of the camera (large smooth gradients with very dark and bright areas,
and had reflectance standards for the absolute calibration).
Camera: EOS T1i Rebel with 28-105mm lens, at 28mm
Calibrated at the grey reflectance sample 186.45 cd/m2
CF=0.957

I’ve got the following RC for RGB:
red(r) = -6.434199e-03+ 4.518039e-01*r + 1.291426e+00*r^2 + 1.802896e+00*r^3;
green(g) = -5.804720e-03+ 4.175837e-01*g + 1.176582e+00*g^2 + 1.721643e+00*g^3;
blue(b) = -4.376831e-03+ 3.784418e-01*b + 1.075695e+00*b^2 + 1.658471e+00*b^3

If I look at the histogram of the scene, maximum
luminance within the scene is 60,291 cd/m2.

Then I use this RC to analyze HDRI of a captured LED.
The value is 230,000 cd/m2 for a single LED, which is low (it’s has
to be around 7*106 cd/m2). So, it underestimates the
luminance.

It seems like calibration point is critical here. I’ve
decided to try to capture a different scene for deriving RC with a wider range.
It would make sense that camera has to see higher luminance values in order to
accurately measure them later. The dynamic range has to cover measured values.

1. 1. How does
Photosphere deals/approximates/calculates the upper end of the curve? I assume
it gives more weight to mid tone values? But what happens with high luminance
values?

So, the new brighter scene was picked with the direct
sun! But in order to avoid the damage of the camera’s sensor, measurements were
taken before the sunset.

In the new brighter captured scene without the
calibration all values for reflectance standards were overestimated, while the
value for the sun underestimated. Then I decided to calibrate my scene at the
sun!
But when I apply absolute calibration, it simply
multiplies CF to all values.

2. 2. I assumed when CF
is applied, it does not equally change all values, but does it proportionally
to RC (since it is not linear). Why does
it do it equally for the whole range?

Lsun=80*106 cd/m2. And of course
CF is very big 391.

New RC:

red(r) = 3.219064e+00+ -2.655078e+01*r + 9.351069e+02*r^2 + -2.115052e+03*r^3+1.594538e+03*r^4;
green(g) = 2.094164e+00+ -1.468109e+00*g + 7.306838e+02*g^2 + -1.720743e+03*g^3+1.380693e+03*g^4;
blue(b) = 1.049078e+00+ 1.591820e+01*b + 5.848958e+02*b^2 + -1.461635e+03*b^3+1.251033e+03*b^4

But then something interesting happened. When I
analyze LED, it gives a value of 79*106 cd/m2. So, it
jumps to this upper limit calibrated with the sun previously.
(I had similar results for EOS 7D with the lens 16-35mm,
at 16mm)

3. 3. Does photosphere
compress the response curve, so at the upper end all values above certain
threshold will have the same number?

4. 4. Any additional
suggestions on properly obtaining and calibrating HDRI for this purpose?

Thank you,
Yulia Tyukhova

Fulbright Scholar, "Intern LC"
Architectural Engineering Graduate Student, UNL-Omaha, NE, USA
B.E. and M.E. in Lighting Engineering (MPEI), Moscow, Russia
[email protected]
[email protected]
+1 (402) 996 0910
PKI 247