Hi Mio,

I am not seeing the same problems as you are.  Here is what I get using your exact command with my version of raw2hdr:


Have you updated your version of dcraw?  Sometimes, there are improvements and bug fixes (and new camera support) that require an update.  I am currently using dcraw v9.26, and the attached raw2hdr.pl script.


Attachment: raw2hdr.pl
Description: application/applefile

#!/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;

The latest version of dcraw is always available from Dave Coffin's website:


Just download dcraw.c and compile with:

cc -DNODEPS -O2 -o dcraw dcraw.c -lm

Then (of course) copy the new version of dcraw to the appropriate executable directory.

The green cast could be a white balance issue.  Sometimes, using raw2hdr -w helps with this.  I wasn't seeing it (at least not severely) in my run, though.

Best,
-Greg


From: "Gregory J. Ward" <[email protected]>

Subject: Re: [HDRI] raw2hdr Image Issues

Date: July 1, 2015 9:39:17 AM PDT


I mean for the NEF files.  If you could upload as a ZIP, that would be great.  I just found the JPEG archive attachment.

Cheers,
-G

From: Mio Jane Stanley <[email protected]>

Subject: Re: [HDRI] raw2hdr Image Issues

Date: July 1, 2015 7:57:29 AM PDT


​​Greg,

Below is the input I used to create the HDR images, the images are attached in a zip file.

raw2hdr -o outputHalfOnF9RAW.hdr DSC_0102.NEF DSC_0103.NEF DSC_0104.NEF DSC_0105.NEF DSC_0106.NEF DSC_0107.NEF DSC_0108.NEF DSC_0109.NEF DSC_0110.NEF DSC_0111.NEF DSC_0112.NEF DSC_0113.NEF DSC_0114.NEF DSC_0115.NEF DSC_0116.NEF DSC_0117.NEF DSC_0118.NEF DSC_0119.NEF DSC_0120.NEF 


hdrgen -o outputHalfOnF9JPEG.hdr -a DSC_0102.JPG DSC_0103.JPG DSC_0104.JPG DSC_0105.JPG DSC_0106.JPG DSC_0107.JPG DSC_0108.JPG DSC_0109.JPG DSC_0110.JPG DSC_0111.JPG DSC_0112.JPG DSC_0113.JPG DSC_0114.JPG DSC_0115.JPG DSC_0116.JPG DSC_0117.JPG DSC_0118.JPG DSC_0119.JPG DSC_0120.JPG 


On Tue, Jun 30, 2015 at 6:00 PM, Gregory J. Ward <[email protected]> wrote:
Hi Mio,

Can you send me the original exposures (JPEG & RAW) as well as the options you are using for hdrgen and raw2hdr?

Thanks.
-Greg


From: Mio Jane Stanley <[email protected]>

Subject: [HDRI] raw2hdr Image Issues

Date: June 30, 2015 1:29:17 PM PDT


​​
​​
​All,

I have recently been using hdrgen and raw2hdr in an effort to make comparisons between the quality of data between JPEG and RAW image files. However, I have come across a couple of issues with raw2hdr. The main one being that we are getting a consistent green tint to the RAW HDR images created with raw2hdr, which is not shown in its counterpart HDR image created with hdrgen. I have attached the images for reference. The two HDR images are composed of the same sets of LDR images taken at the same time except, of course, with one created with the JPEG files and one with the RAW files. 

A second issue, which has only happened once so far, is that I am getting a diagonal white bar in the final composed HDR image. I was able to create a corrected image by toggling on the -x setting, to remove over- and under-exposed images, but I was still curious what exactly is causing this type of error so I can avoid it moving forward. Again, image has been attached for reference. 

If the links to the images are not working, please let me know and I can send them directly.

Any insight is much appreciated!
Mio Stanley
Graduate Student, University of Colorado Boulder
_______________________________________________
HDRI mailing list
[email protected]
http://www.radiance-online.org/mailman/listinfo/hdri



[The attachment Archive.zip has been manually removed]

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

Reply via email to