[Radiance-general] get pixel value

Greg Ward gregoryjward at gmail.com
Tue May 31 09:48:49 PDT 2016


Hi Stephen,

This is what I would do -- pcompos doesn't do any processing on pixels, so it would be difficult to come up with something faster.

The only issue with your method is that pcompos shifts header lines on the input, so any EXPOSURE= settings are lost.  As a result, you won't get the desired absolute value from your command if an exposure change has been applied.  This is also why pcompos is problematic when processing HDR images from Photosphere or hdrgen, which typically include the calibration factor as an EXPOSURE= line in the header.

The following fix for this problem is ugly, but quicker than processing the entire image to correct the exposure:

	set val=`pcompos -x 1 -y 1 pic.hdr -300 -450 | pvalue -h -b -H -d`
	set expos=`getinfo < pic.hdr | sed -n 's/EXPOSURE=//p' | total -p'
	set result = `ev "$val / $expos"`

The second line allows for multiple EXPOSURE= lines, which can happen when you process the image with pfilt, for example.

Cheers,
-Greg

> From: Stephen Wasilewski <stephen at coolshadow.com>
> Date: May 31, 2016 9:36:11 AM PDT
> 
> What is the fastest (computationally) way to look up a single pixel value in a radiance picture?  
> currently I'm doing it like this:
> 
> pcompos -x 1 -y 1 pic.hdr -300 -450 | pvalue -o -h -b -H -d
> 
> is there a better way?
> 
> 
> Thanks,
> 
> Stephen Wasilewski
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.radiance-online.org/pipermail/radiance-general/attachments/20160531/ef531345/attachment.html>


More information about the Radiance-general mailing list