[Radiance-general] image formatting for input to evalglare

Greg Ward gregoryjward at gmail.com
Tue Mar 1 08:14:47 PST 2011


Hi Kyle,

This discussion probably belongs on the HDRI list, so I'm cross-posting there.

The thing about pcompos is that it doesn't transfer exposure information, which you need for most images to get the absolute numbers back.  Here are the commands you want:

echo "VIEW= -vta -vh 180 -vv 180 -vp 0 0 0 -vd 1 0 0 -vu 0 0 1" > corrected.hdr
ra_xyze -r -o -u orig.hdr | pcompos -x 1200 - -200 0 >> corrected.hdr

The first one puts the view information you want in the header.  The ra_xyze command undoes the exposure on the image before passing it to pcompos, which does the cropping and appends it to the view header.

Hope this works.
-Greg

> From: kkonis at berkeley.edu
> Date: March 1, 2011 6:48:48 AM PST
> 
> Dear list,
> 
> I am trying to format HDR images produced from a Canon A570 digital camera
> with a 180 deg fisheye converter attached.
> 
> The images are 1600,1200 pixels (x,y) and have the circular "fisheye" view
> centered in the image.
> 
> I need to do three operations:
> 
> 1) crop image down to a square shape, so that it bounds the hemispherical
> view of the lens and
> 
> 2) filter the cropped image down to less than 800 x 800 pixels to input to
> evalglare (i can do this with pfilt -1, and this works fine so long as
> pcompos is not involved)
> 
> 3) then i need to edit the image file's header info and trick it into
> thinking it has a 180 view (since the camera does not know it has a
> converter attached!) e.g.
> 
> 
> VIEW= -vta -vh 180 -vv 180 -vp 0 0 0 -vd 1 0 0 -vu 0 0 1
> 
> 
> Right now i am perplexed when i use pcompos to crop the image via:
> 
> pcompos -x 1200 input/$image -200 0 > output/{$image}
> 
> The result is a new "cropped" hdr image that looks great from a cropping
> standpoint, but the luminance values are much lower when viewed in
> photosphere (compared to the orig image)
> 
> My guess is there is something happening to the header:
> 
> here is the original header:
> 
> 
> #?RADIANCE
> CAMERA= Canon Canon PowerShot A570 IS version v.0
> EXPOSURE=8.278360e-02
> VIEW= -vtv -vh 52.456387 -vv 40.558973
> CAPDATE= 2010:10:07 10:41:59
> hdrgen created HDR image from 'IMG_0450.JPG' 'IMG_0449.JPG' 'IMG_0448.JPG'
> 'IMG_0447.JPG' 'IMG_0446.JPG' 'IMG_0445.JPG' 'IMG_0444.JPG' 'IMG_0443.JPG'
> 'IMG_0442.JPG' 'IMG_0441.JPG'
> PRIMARIES= 0.6400 0.3300 0.3000 0.6000 0.1500 0.0600 0.3127 0.3290
> FORMAT=32-bit_rle_rgbe
> 
> -Y 1200 +X 1600
> 
> ................ and the result after the pcompos ...................
> 
> #?RADIANCE
> CAPDATE= 2011:03:01 06:30:57
> GMT= 2011:03:01 14:30:57
> input/201010071045.hdr:
> 	CAMERA= Canon Canon PowerShot A570 IS version v.0
> 	EXPOSURE=8.778544e-02
> 	VIEW= -vtv -vh 52.456387 -vv 40.558973
> 	CAPDATE= 2010:10:07 10:46:59
> 	hdrgen created HDR image from 'IMG_0460.JPG' 'IMG_0459.JPG'
> 'IMG_0458.JPG' 'IMG_0457.JPG' 'IMG_0456.JPG' 'IMG_0455.JPG'
> 'IMG_0454.JPG' 'IMG_0453.JPG' 'IMG_0452.JPG' 'IMG_0451.JPG'
> 	PRIMARIES= 0.6400 0.3300 0.3000 0.6000 0.1500 0.0600 0.3127 0.3290
> pcompos -x 1200 input/201010071045.hdr -200 0
> FORMAT=32-bit_rle_rgbe
> 
> -Y 1200 +X 1200
> 
> ..................................................................
> 
> While on the subject of header manipulation, I am eager for suggestions
> for how to edit lines of the header. In my case i want to replace the
> original view line
> 
> VIEW= -vtv -vh 52.456387 -vv 40.558973
> 
> 
> with
> 
> 
> VIEW= -vta -vh 180 -vv 180 -vp 0 0 0 -vd 1 0 0 -vu 0 0 1
> 
> 
> 
> I have tried doing this "manually" in BBedit and Xcode, but get an
> "unexpected end of file" error
> 
> 
> 
> Any suggestions are appreciated!
> 
> -Kyle
> 
> Kyle Konis
> Ph.D. Candidate
> Dept. of Architecture (Building Science)
> University of California, Berkeley
> Research Assistant, Lawrence Berkeley National Lab
> Tel. (206) 303 9786
> Email: kkonis at berkeley.edu
> 



More information about the Radiance-general mailing list