[Radiance-general] Calculating pixel value at a specific location
in an image
Thomas Bleicher
tbleicher at googlemail.com
Tue Apr 6 01:42:11 PDT 2010
Chris.
I assume you want to extract a single Lux value from an image.
My first idea would be to use pcompos to reduce the image size to a
1x1 image and then have pvalue convert that to R,G,B:
pcompos -x 1 -y 1 image.hdr -xpos -ypos | pvalue -o -d -h -H
-xpos and -ypos are the negative offset of the pixel you want to
calculate. So if you want to know the value at (321,123) it would be
pcompos -x 1 -y 1 image.hdr -321 -123 | pvalue -o -d -h -H
You have to experiment with the offset. You might have to add or
substract 1 to get exactly the pixel you want.
The you just use the standard conversion of R,G,B to Lux with rcalc:
pcompos -x 1 -y 1 image.hdr -xpos -ypos | pvalue -o -d -h -H | rcalc
-e '$1=($1*0.265+$2*0.67+$3*0.065)*179'
Regards,
Thomas
On Mon, Apr 5, 2010 at 10:53 PM, Chris Humann <chris at coolshadow.com> wrote:
> Greetings all,
> I'm trying to use 'pvalue' to calculate a pixel value at a specific x,y
> location in an image by piping 'pvalue' through 'rcalc', and am stuck on
> the correct syntax to use for the expression, '-e', in 'rcalc':
> pvalue -o -h -H rendered_image.hdr | rcalc -e '(x_location,y_location)'
> Has anyone tackled this in the past?
> As always, thanks!
> Chris
> Christian Humann ~ Associate
> LOISOS + UBBELOHDE
> - - - - - - - - - - - - - - - - - - - - - - - - - - -
> 1917 Clement Avenue Building 10A
> Alameda, CA 94501 USA
> - - - - - - - - - - - - - - - - - - - - - - - - - - -
> 510 521 3800 VOICE
> 510 521 3820 FAX
> - - - - - - - - - - - - - - - - - - - - - - - - - - -
> www.coolshadow.com
More information about the Radiance-general
mailing list