Hi Clotilde,
Have you tried using the raw2hdr script, which calls dcraw and exiftool as well
as hdrgen? I have found this to be a more reliable method than using hdrgen
alone. However, you will need to download and install dcraw.c and exiftool to
get it working. These tools and the raw2hdr script are included in the Mac OS
X command-line HDR image builder available from www.anyhere.com.
If you are on Linux, you can download and install the other tools from the web
and use the attached script.
Best,
-Greg
#!/usr/bin/perl -w
#
# Convert camera RAW file to HDR image
# Based on dcraw version 8.94 (May 15, 2009)
# Also requires hdrgen and exiftool
#
if ($#ARGV < 0) {
print "Usage: raw2hdr [hdrgen opts][-h][-w][-C calib][-c cspace] -o output.hdr input1.raw ..\n";
exit 1;
}
my $td = `mktemp -d /tmp/raw2hdr.XXXXXX`;
chomp $td;
# Calibration factor for our camera:
my $calib_fact = 1;
my $bscale = 1.1;
my @dcraw = qw(dcraw -c -t 0 -W -g 2 0 -T);
my @exiftags = qw( -GPSDateStamp -GPSTimeStamp -GPSLatitude -GPSLatitudeRef
-GPSLongitude -GPSLongitudeRef -GPSAltitude -GPSAltitudeRef
-Orientation -ImageOrientation -CameraOrientation
-FocalLengthIn35mmFormat -UserComment -FocusDistance\>SubjectDistance );
my @hdrgen = "hdrgen -m 400 -e -a -r $td/sqr.rsp";
my $ocs = "sRGB";
my $force_write = 0;
my $outfile;
while ($#ARGV >= 0) {
if ("$ARGV[0]" eq "-c") {
shift @ARGV;
$ocs = $ARGV[0];
} elsif ("$ARGV[0]" eq "-C") {
shift @ARGV;
$calib_fact = $ARGV[0];
} elsif ("$ARGV[0]" eq "-o") {
shift @ARGV;
$outfile = $ARGV[0];
push @hdrgen, "-o $outfile";
} elsif ("$ARGV[0]" =~ /^-[qmp]$/) {
push @hdrgen, "$ARGV[0] $ARGV[1]";
shift @ARGV;
} elsif ("$ARGV[0]" eq "-m") {
shift @ARGV;
push @hdrgen, "-m $ARGV[0]";
} elsif ("$ARGV[0]" eq "-F") {
$force_write = ! $force_write;
} elsif ("$ARGV[0]" =~ /^-[aefgx]$/) {
push @hdrgen, $ARGV[0];
} elsif ("$ARGV[0]" =~ /^-[rs]$/) {
print "hdrgen $ARGV[0] option not supported";
exit 1;
} elsif ("$ARGV[0]" =~ /^-[hw]$/) {
push @dcraw, $ARGV[0];
} elsif ("$ARGV[0]" eq "-b") {
shift @ARGV;
$bscale = $ARGV[0];
} elsif ("$ARGV[0]" =~ /^-./) {
print "Unknown option: $ARGV[0]\n";
exit 1;
} else {
last;
}
shift @ARGV;
}
if (not $outfile) {
print "Missing -o output file specification\n";
exit 1;
}
if ($force_write) {
push @hdrgen, "-F";
} elsif (-e $outfile) {
print "$outfile: file exists\n";
exit 1;
}
if ("$ocs" eq "XYZ") {
# CIE XYZ
push @dcraw, "-o 5";
push @exiftags, "'-PrimaryChromaticities=1.00 0.00 0.00 1.00 0.00 0.00'",
"'-WhitePoint=.3333 .3333'";
} elsif ("$ocs" eq "AdobeRGB") {
# Adobe RGB (1998)
push @dcraw, "-o 2";
push @exiftags, "'-PrimaryChromaticities=0.64 0.33 0.21 0.71 0.15 0.06'",
"'-WhitePoint=.3127 .3290'";
} elsif ("$ocs" eq "sRGB") {
# sRGB is dcraw default and what hdrgen expects on input
push @dcraw, "-o 1"
} else {
die "Unsupported output color space";
}
push @hdrgen, "-c $ocs";
push @dcraw, "-b $bscale";
open OUTF, '>', "$td/sqr.rsp";
print OUTF "2 $calib_fact 0 0\n" x 3;
close OUTF;
foreach my $rawfile (@ARGV) {
$_ = $rawfile;
s|.*/||g;
s/\.[^.]*$/.tif/;
my $tiff = "$td/$_";
system "@dcraw -v $rawfile > $tiff" and die 'dcraw failed';
system "exiftool -overwrite_original -TagsFromFile '$rawfile' @exiftags $tiff";
push @hdrgen, $tiff;
}
print "Executing: @hdrgen\n";
my $res = system "@hdrgen";
system "rm -rf $td";
exit $res;
> From: Clotilde Pierson <[email protected]>
> Date: February 10, 2017 5:01:42 AM PST
>
> Dear Alex,
> Dear Alstan,
>
>> Are you sure your low dynamic range pictures are properly exposed from
>> which you construct the HDRI?
>>
>> Meaning, the fastest shutter speed picture has no saturation (i.e. all
>> white pixels) and your slowest shutter speed picture has some black
>> pixels? You need to make sure this is true else you won't get proper
>> illuminance calculation and also your bright spots (i.e. high
>> luminance) will be under reported.
>
> Well, I took 15 images with auto-bracketing (1EV between each image). I
> always check that the fastest shutter speed is almost all black pixels (no
> white pixels) and the slowest shutter speed is almost all white pixels (no
> black pixels). If I have too high luminance in my field of view, then I use a
> neutral density filter so that my darkest image does not have any white pixel.
>
>> I'd like to follow up with some other potential things to look out for in
>> addition to what Alex suggested and questions based on your description. We
>> dealt a lot
>> with this via the papers on HDR we published last year.
>
> Yes, I have read it.
>
>> * Full fisheye HDR images should always be cropped to a bounding
>> square and the view edited or input inline via Evalglare when doing
>> analysis. Are you cropping the images in all cases?
>
> Yes, all images are cropped at the end (after hdrgen and vignetting
> calibration) to a 1000x1000 square (with pcompos and pfilt) and the VIEW line
> in the header is modified to a -vta -vh 180 -vv 180.
>
>> * Where is your 1.39 calibration factor derived from? It is useful to
>> measure luminance for every HDR photo taken from an easy to identify
>> (and nearly-neutral) surface for use in calibrating images rather
>> than a constant. Typically the discrepancies I find when I
>> /don't///measure luminance this aren't as high as what you found
>> however.
>
> I derived my calibration factor when doing the vignetting calibration
> process. I did the vignetting calibration according to the method suggested
> in Cauwerts et al. (2013) paper. Therefore I have a calibration factor for
> each aperture:
> f/3.5 --> 1.32
> f/5.6 --> 1.38
> f/11 --> 1.48
> f/16 --> 1.59
> f/22 --> 1.84
>
> The reason why the f/3.5 calibration factor is not 1.39 anymore, is because I
> noticed that using hdrgen command with -e and -a options when creating my HDR
> images, gave me better results. It changes the exposure of the generated HDR
> images and I thus only got differences between measured and HDR-derived
> values of max 30% (it was 50% before). Therefore, I recalculated my
> calibration factors with the last generated HDR images.
>
>> * You should look up the recent discussion, "[HDRI] Convert
>> equisolidangular to equiangular projection" which strongly suggests
>> the Sigma 8mm f/3.5 to be a -vta / equidistant / equi-angle lens.
>> Reprojecting the image could add some error in this case.
>
> Well, I think this is not the case. The SIGMA 8mm f/3.5 has an equisolid
> projection.
> I am quite sure as I received this information from Sigma UK. Moreover, I
> checked the information Sigma gave me by measuring myself the projection of
> the lens. I did it following David Geisler-Moroder method, that he presented
> at the 15th International Radiance Workshop in 2016. And I also got an
> equisolid projection. I could send you more info if you want.
> The images have thus to be reprojected from equisolid to equidistant.
>
> Best,
>
> Clotilde
>
> -----Message d'origine-----
> De : [email protected]
> [mailto:[email protected]]
> Envoyé : jeudi 9 février 2017 23:47
> À : [email protected]
> Objet : HDRI Digest, Vol 88, Issue 7
>
> Send HDRI mailing list submissions to
> [email protected]
>
> To subscribe or unsubscribe via the World Wide Web, visit
> http://www.radiance-online.org/mailman/listinfo/hdri
> or, via email, send a message with subject or body 'help' to
> [email protected]
>
> You can reach the person managing the list at
> [email protected]
>
> When replying, please edit your Subject line so it is more specific than "Re:
> Contents of HDRI digest..."
>
>
> Today's Topics:
>
> 1. Re: Illuminance and luminance values underestimation from
> calibrated HDR images (J. Alstan Jakubiec)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Fri, 10 Feb 2017 06:45:43 +0800
> From: "J. Alstan Jakubiec" <[email protected]>
> To: [email protected]
> Subject: Re: [HDRI] Illuminance and luminance values underestimation
> from calibrated HDR images
> Message-ID: <[email protected]>
> Content-Type: text/plain; charset="windows-1252"; Format="flowed"
>
> Hello Clotilde,
>
> I'd like to follow up with some other potential things to look out for in
> addition to what Alex suggested and questions based on your description. We
> dealt a lot with this via the papers on HDR we published last year.
>
> * Full fisheye HDR images should always be cropped to a bounding
> square and the view edited or input inline via Evalglare when doing
> analysis. Are you cropping the images in all cases?
> * Where is your 1.39 calibration factor derived from? It is useful to
> measure luminance for every HDR photo taken from an easy to identify
> (and nearly-neutral) surface for use in calibrating images rather
> than a constant. Typically the discrepancies I find when I
> /don't///measure luminance this aren't as high as what you found
> however.
> * You should look up the recent discussion, "[HDRI] Convert
> equisolidangular to equiangular projection" which strongly suggests
> the Sigma 8mm f/3.5 to be a -vta / equidistant / equi-angle lens.
> Reprojecting the image could add some error in this case.
>
> Best,
> Alstan
>
> On 2/9/2017 6:09 AM, Alex Mead wrote:
>> Clotilde:
>>
>> Are you sure your low dynamic range pictures are properly exposed from
>> which you construct the HDRI?
>>
>> Meaning, the fastest shutter speed picture has no saturation (i.e. all
>> white pixels) and your slowest shutter speed picture has some black
>> pixels? You need to make sure this is true else you won't get proper
>> illuminance calculation and also your bright spots (i.e. high
>> luminance) will be under reported.
>>
>> - Alex
>>
>> On Wed, Feb 8, 2017 at 11:10 AM, Clotilde Pierson
>> <[email protected] <mailto:[email protected]>>
>> wrote:
>>
>> Dear all,
>>
>> I am using a Canon EOS 5D Mark II with a Sigma EX DG 8mm f/3.5
>> fisheye lens to capture LDR images. I then use hdrgen with the
>> response curves I defined previously to generate HDR images from
>> these LDR images. I calibrate the HDR images for the vignetting
>> effect and the distortion (equisolid to equidistant projection).
>> Finally, I apply a calibration factor of around 1.39.
>>
>> When comparing the vertical illuminance and luminance values of
>> the HDR images with the real measures I took (Minolta LS-110
>> luminancemeter and Hagner EC1-X luxmeter), I noticed that the HDR
>> images are underestimating the illuminance (e.g. 1217lux instead
>> of 1993lux) and the high luminance values (e.g. 208 cd/m? instead
>> of 402.3cd/m?). I determined the illuminance value of an HDR with
>> Evalglare ?V and the luminance values with ximage in Radiance.
>>
>> I also tried only applying default hdrgen (+cropping & header
>> modification to set the VIEW to vta to use in Evalglare) but I
>> still got big differences between the HDR-derived and the measured
>> luminance and illuminance values.
>>
>> Is somebody using the same instruments I am? If yes, do you also
>> happen to have this issue? Or does anybody have already encounter
>> this problem?
>>
>> Thank you for your insights !
>>
>> Best,
>>
>> Clotilde
>>
>> *Test*
>>
>> **
>>
>> *Clotilde Pierson*
>>
>> /FNRS PhD Fellow | Arch. Eng./
>>
>> *Architecture et Climat**
>> *Facult? d?architecture, d?ing?nierie architecturale et
>> d?urbanisme (LOCI)
>>
>> Universit? catholique de Louvain (UCL)
>> Place du Levant, 1 bte L5.05.04 B-1348 - Louvain-la-Neuve (Belgique)
>> [email protected]
>> <mailto:[email protected]>
>>
>> T?l. 32 (0)10 47 91 52 - Fax 32 (0)10 47 21 50
>> http://www.uclouvain.be/architecture-climat.html
>> <http://www.uclouvain.be/architecture-climat.html>
>>
>>
>> _______________________________________________
>> HDRI mailing list
>> [email protected] <mailto:[email protected]>
>> http://www.radiance-online.org/mailman/listinfo/hdri
>> <http://www.radiance-online.org/mailman/listinfo/hdri>
>>
>>
>>
>>
>> --
>> Alex Mead
>> (616) 901-2479, UC Berkeley Systems Engineering Ph.D. (expected 2017),
>> www.alex-mead.com <http://www.alex-mead.com>
>>
>> www.CEEphotos.com <http://www.ceephotos.com> - web master, creator
>>
>>
>> _______________________________________________
>> HDRI mailing list
>> [email protected]
>> http://www.radiance-online.org/mailman/listinfo/hdri
>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> <http://www.radiance-online.org/pipermail/hdri/attachments/20170210/c4feb8c3/attachment.html>
> -------------- next part --------------
> A non-text attachment was scrubbed...
> Name: not available
> Type: image/png
> Size: 19407 bytes
> Desc: not available
> URL:
> <http://www.radiance-online.org/pipermail/hdri/attachments/20170210/c4feb8c3/attachment.png>
>
> ------------------------------
>
> Subject: Digest Footer
>
> _______________________________________________
> HDRI mailing list
> [email protected]
> http://www.radiance-online.org/mailman/listinfo/hdri
>
>
> ------------------------------
>
> End of HDRI Digest, Vol 88, Issue 7
> ***********************************
>
> _______________________________________________
> HDRI mailing list
> [email protected]
> http://www.radiance-online.org/mailman/listinfo/hdri
_______________________________________________
HDRI mailing list
[email protected]
http://www.radiance-online.org/mailman/listinfo/hdri