get pixel value

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
*LOISOS *+* UBBELOHDE*
- - - - - - - - - - - - - - - - - - - - - - - - - - -
1917 Clement Avenue Building 10A
Alameda, CA 94501 USA
- - - - - - - - - - - - - - - - - - - - - - - - - - -
510 521 3800 VOICE
510 521 3820 FAX
- - - - - - - - - - - - - - - - - - - - - - - - - - -
www.coolshadow.com

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 <[email protected]>
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