Obtaining proper luminance values in scene image generated using HDR sky-probe luminance data

Dear list,

I am exploring image-based lighting in Radiance and have encountered
several issues with the luminance values in the scene images i am
generating. I am starting with a hemispherical fisheye image of the
sky which must be cropped to a square format via pcompos.

This process leads to a header which puts the EXPOSURE=5.953331e-03 in
a location which creates a problem in that the pixel values, as viewed
in Photosphere or when rendered via rpict to a test image (looking up
from the origin at the sky), are much lower than the original HDR
image.

#?RADIANCE
CAPDATE= 2012:10:21 17:05:24
GMT= 2012:10:22 00:05:24
20111019_cloudy/201110191248.hdr:
        CAMERA= Canon Canon PowerShot A570 IS version v.0
        EXPOSURE=5.953331e-03
        VIEW= -vtv -vh 52.456387 -vv 40.558973
        CAPDATE= 2011:10:19 12:48:08
        hdrgen created HDR image from 'IMG_0685.JPG' 'IMG_0684.JPG'
'IMG_0683.JPG' 'IMG_0682.JPG' 'IMG_0681.JPG'
        PRIMARIES= 0.6400 0.3300 0.3000 0.6000 0.1500 0.0600 0.3127 0.3290
pcompos -x 1280 -y 1280 20111019_cloudy/201110191248.hdr -340 -100
pfilt -1 -x 600 -y 600
pflip -v -c
pflip -h -c
FORMAT=32-bit_rle_rgbe
protate -r -c

-Y 600 +X 600

In other words, when the EXPOSURE=5.953331e-03 line is in its
original position, e.g.:

#?RADIANCE
CAMERA= Canon Canon PowerShot A570 IS version v.0
EXPOSURE=5.953331e-03
VIEW= -vtv -vh 52.456387 -vv 40.558973
CAPDATE= 2011:10:19 12:48:08
hdrgen created HDR image from 'IMG_0685.JPG' 'IMG_0684.JPG'
'IMG_0683.JPG' 'IMG_0682.JPG' 'IMG_0681.JPG'
PRIMARIES= 0.6400 0.3300 0.3000 0.6000 0.1500 0.0600 0.3127 0.3290
FORMAT=32-bit_rle_rgbe

-Y 1536 +X 2048

...... all is well, and the image displays the correct luminance
values for the sky in Photosphere. Because i need to crop this image
to a square format to use it as a light probe, i cannot confirm that a
test image (again, looking up from the origin) would render with the
proper luminance values, but my guess is that it would.

I am using the following text to describe an image-based lighting
environment consisting of a hemispherical fish-eye image of the sky.

# Image-Based Lighting Environment
void colorpict hdr_probe_image
7 red green blue sky_image/HDR_sky_temp.hdr angmap_sky.cal u v
0
0

# specify a "glow" material that will use this image
hdr_probe_image glow light_probe
0
0
4 1 1 1 0

light_probe source ibl_environment
0
0
4 0 0 1 180

I have tried a number of scripts to manipulate the header text to
return the EXPOSURE=5.953331e-03 line to a location where it is again
utilized. In this example (below), which just sticks the line up at
the top, Photosphere reads the image and scales the pixels by the
exposure value. However, when a scene is rendered using the image as a
light probe, the test image again has very low sky luminance values.

#?RADIANCE
EXPOSURE=5.953331e-03
#?RADIANCE
CAPDATE= 2012:10:21 17:05:24
GMT= 2012:10:22 00:05:24
20111019_cloudy/201110191248.hdr:
        CAMERA= Canon Canon PowerShot A570 IS version v.0
        EXPOSURE=5.953331e-03
        VIEW= -vtv -vh 52.456387 -vv 40.558973
        CAPDATE= 2011:10:19 12:48:08
        hdrgen created HDR image from 'IMG_0685.JPG' 'IMG_0684.JPG'
'IMG_0683.JPG' 'IMG_0682.JPG' 'IMG_0681.JPG'
        PRIMARIES= 0.6400 0.3300 0.3000 0.6000 0.1500 0.0600 0.3127 0.3290
pcompos -x 1280 -y 1280 20111019_cloudy/201110191248.hdr -340 -100
pfilt -1 -x 600 -y 600
pflip -v -c
pflip -h -c
FORMAT=32-bit_rle_rgbe
protate -r -c

-Y 600 +X 600

My questions to the list, ultimately are:

1) Does the colorpict pattern type, or image-based lighting process in
general, have any relationship to the EXPOSURE value of the HDR image?
If not, i suppose the solution is to scale all the pixel values in
the image and forget about where the EXPOSURE line is in the header.

2) If the EXPOSURE line in the header is relevant, can anyone
recommend a scripting technique to cook up the proper header text and
then attach the binary image data from the manipulated (e.g. pcompos,
pflip, pfilt) HDR images? For example, i have used "getinfo" to grab
the header from the original image and "grep" to grab the EXPOSURE
line, i write these to a new file (with #?RADIANCE) as the first line.
I then cat the manipulated image file to this new file. This results
in an inelegant header for the new file, works in Photosphere, but, as
mentioned above, does not lead to a proper sky luminance results when
used to generate scene images in radiance.

Any suggestions would be appreciated!

-Kyle

Kyle,

You can set the exposure to 1 (pfilt) to prevent the problems you are experiencing with the probe.

Mehlika

···

On Fri, 23 Nov 2012, Kyle Konis wrote:

Dear list,

I am exploring image-based lighting in Radiance and have encountered
several issues with the luminance values in the scene images i am
generating. I am starting with a hemispherical fisheye image of the
sky which must be cropped to a square format via pcompos.

This process leads to a header which puts the EXPOSURE=5.953331e-03 in
a location which creates a problem in that the pixel values, as viewed
in Photosphere or when rendered via rpict to a test image (looking up
from the origin at the sky), are much lower than the original HDR
image.

#?RADIANCE
CAPDATE= 2012:10:21 17:05:24
GMT= 2012:10:22 00:05:24
20111019_cloudy/201110191248.hdr:
       CAMERA= Canon Canon PowerShot A570 IS version v.0
       EXPOSURE=5.953331e-03
       VIEW= -vtv -vh 52.456387 -vv 40.558973
       CAPDATE= 2011:10:19 12:48:08
       hdrgen created HDR image from 'IMG_0685.JPG' 'IMG_0684.JPG'
'IMG_0683.JPG' 'IMG_0682.JPG' 'IMG_0681.JPG'
       PRIMARIES= 0.6400 0.3300 0.3000 0.6000 0.1500 0.0600 0.3127 0.3290
pcompos -x 1280 -y 1280 20111019_cloudy/201110191248.hdr -340 -100
pfilt -1 -x 600 -y 600
pflip -v -c
pflip -h -c
FORMAT=32-bit_rle_rgbe
protate -r -c

-Y 600 +X 600

In other words, when the EXPOSURE=5.953331e-03 line is in its
original position, e.g.:

#?RADIANCE
CAMERA= Canon Canon PowerShot A570 IS version v.0
EXPOSURE=5.953331e-03
VIEW= -vtv -vh 52.456387 -vv 40.558973
CAPDATE= 2011:10:19 12:48:08
hdrgen created HDR image from 'IMG_0685.JPG' 'IMG_0684.JPG'
'IMG_0683.JPG' 'IMG_0682.JPG' 'IMG_0681.JPG'
PRIMARIES= 0.6400 0.3300 0.3000 0.6000 0.1500 0.0600 0.3127 0.3290
FORMAT=32-bit_rle_rgbe

-Y 1536 +X 2048

...... all is well, and the image displays the correct luminance
values for the sky in Photosphere. Because i need to crop this image
to a square format to use it as a light probe, i cannot confirm that a
test image (again, looking up from the origin) would render with the
proper luminance values, but my guess is that it would.

I am using the following text to describe an image-based lighting
environment consisting of a hemispherical fish-eye image of the sky.

# Image-Based Lighting Environment
void colorpict hdr_probe_image
7 red green blue sky_image/HDR_sky_temp.hdr angmap_sky.cal u v
0

# specify a "glow" material that will use this image
hdr_probe_image glow light_probe
0
4 1 1 1 0

light_probe source ibl_environment
0
4 0 0 1 180

I have tried a number of scripts to manipulate the header text to
return the EXPOSURE=5.953331e-03 line to a location where it is again
utilized. In this example (below), which just sticks the line up at
the top, Photosphere reads the image and scales the pixels by the
exposure value. However, when a scene is rendered using the image as a
light probe, the test image again has very low sky luminance values.

#?RADIANCE
EXPOSURE=5.953331e-03
#?RADIANCE
CAPDATE= 2012:10:21 17:05:24
GMT= 2012:10:22 00:05:24
20111019_cloudy/201110191248.hdr:
       CAMERA= Canon Canon PowerShot A570 IS version v.0
       EXPOSURE=5.953331e-03
       VIEW= -vtv -vh 52.456387 -vv 40.558973
       CAPDATE= 2011:10:19 12:48:08
       hdrgen created HDR image from 'IMG_0685.JPG' 'IMG_0684.JPG'
'IMG_0683.JPG' 'IMG_0682.JPG' 'IMG_0681.JPG'
       PRIMARIES= 0.6400 0.3300 0.3000 0.6000 0.1500 0.0600 0.3127 0.3290
pcompos -x 1280 -y 1280 20111019_cloudy/201110191248.hdr -340 -100
pfilt -1 -x 600 -y 600
pflip -v -c
pflip -h -c
FORMAT=32-bit_rle_rgbe
protate -r -c

-Y 600 +X 600

My questions to the list, ultimately are:

1) Does the colorpict pattern type, or image-based lighting process in
general, have any relationship to the EXPOSURE value of the HDR image?
If not, i suppose the solution is to scale all the pixel values in
the image and forget about where the EXPOSURE line is in the header.

2) If the EXPOSURE line in the header is relevant, can anyone
recommend a scripting technique to cook up the proper header text and
then attach the binary image data from the manipulated (e.g. pcompos,
pflip, pfilt) HDR images? For example, i have used "getinfo" to grab
the header from the original image and "grep" to grab the EXPOSURE
line, i write these to a new file (with #?RADIANCE) as the first line.
I then cat the manipulated image file to this new file. This results
in an inelegant header for the new file, works in Photosphere, but, as
mentioned above, does not lead to a proper sky luminance results when
used to generate scene images in radiance.

Any suggestions would be appreciated!

-Kyle

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

Thanks for the responses, i used :

ra_xyze -r -o | pcompos .....

Which solved the issue that i was having

-Kyle

something that Greg and Santiago discussed a while ago (and wrote for us):

#!/bin/csh -fe # Undo any exposure to one or more Radiance pictures
foreach i ($*)
set expos=`sed -n -e 's/^EXPOSURE=//p' -e '/^$/q' $i | total -p`
pfilt -1 -e `ev 1/$expos` $i > $i.$$
mv $i.$$ $i
end

may be of help
G

···

On 24 Nov 2012, at 08:05, Lars O. Grobe <[email protected]> wrote:

I pipe any image data I get from files through 'pcomb -o -' before further using it. Just to make sure I use the original values.

Well, not always, sometimes I forget... sigh :wink:

Cheers, Lars.
_______________________________________________
Radiance-general mailing list
[email protected]
http://www.radiance-online.org/mailman/listinfo/radiance-general