Calculating pixel value at a specific location in an image

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

···

On Mar 30, 2010, at 8:31 AM, Jack de Valpine wrote:

Hi All,

I have compiled the latest Radiance release (4.0) on Ubuntu 9.10. For those who are interested, I have placed a tarball on our ftp site which can be downloaded as follows:
go to: ftp.visarc.com
user: u36117396-rad
passwd: rad-r40
get: rad4R0-linux-ubuntu.tgz
This is a temporary location for the short term. I will check in with Greg about making this available through www.radiance-online.org.

Please see the README for some basic notes on installation. Note that I have also included the documentation directory.

Please let me know if there are any questions and I will answer them as I am able.

Regards,

-Jack de Valpine
--
# Jack de Valpine
# president
#
# visarc incorporated
# http://www.visarc.com
#
# channeling technology for superior design and construction

Jack de Valpine wrote:

Hi All,

I just wanted to report that Radiance 4.0 compiled with no problems on the following Linux variants:
Fedora Core 5 - yes an old file server but still running strong
Ubuntu 9.10 - the only thing that I had to do was install the following packages to get the compile to work smoothly:
csh
libx11-dev
-Jack
--
# Jack de Valpine
# president
#
# visarc incorporated
# http://www.visarc.com
#
# channeling technology for superior design and construction

Thomas Bleicher wrote:

On Thu, Mar 18, 2010 at 10:19 PM, Fitzsimmons, Rob >>> <[email protected]> wrote:

Yes, I usually launch X11.app

Is there any harm in having all other binaries as 4.0, but keeping the rvu
3.9 version?

There should not be a big problem. But you will not be able to use the
new fancy multi-process option. I don't know if rad can pass that on
to a rvu but if it would try at some point you will get an error.

That’s working for me now. Correct me if I’m wrong but rvu is only used to
display in X11 is not used in producing an hdr image.

No. rvu is interactively producing the image. To display an image you
would use ximage. Have you tested that yet? Or glrad? I think those
are the only apps that need xlib.

Regards,
Thomas

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

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

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

My apologies for not being more specific when posting earlier. I also just realized that I missed a similar post in the archives from May 2008. However, the latter posts don't quite answer the question at hand.

I have a series of images produced from a script in which the previous image octree is over written prior to the proceeding rpict call. Given the latter condition, I don't think vwrays connected to rtrace will work as I don't have the corresponding 'octree' file.
I suppose I could write a Python Script to parse the pixel location and its associated value, but that seems a bit over kill for what seems should be a straight forward, one line task.

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

Thanks again.
Chris

···

On Apr 5, 2010, at 2:53 PM, Chris Humann 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

On Mar 30, 2010, at 8:31 AM, Jack de Valpine wrote:

Hi All,

I have compiled the latest Radiance release (4.0) on Ubuntu 9.10. For those who are interested, I have placed a tarball on our ftp site which can be downloaded as follows:
go to: ftp.visarc.com
user: u36117396-rad
passwd: rad-r40
get: rad4R0-linux-ubuntu.tgz
This is a temporary location for the short term. I will check in with Greg about making this available through www.radiance-online.org.

Please see the README for some basic notes on installation. Note that I have also included the documentation directory.

Please let me know if there are any questions and I will answer them as I am able.

Regards,

-Jack de Valpine
--
# Jack de Valpine
# president
#
# visarc incorporated
# http://www.visarc.com
#
# channeling technology for superior design and construction

Jack de Valpine wrote:

Hi All,

I just wanted to report that Radiance 4.0 compiled with no problems on the following Linux variants:
Fedora Core 5 - yes an old file server but still running strong
Ubuntu 9.10 - the only thing that I had to do was install the following packages to get the compile to work smoothly:
csh
libx11-dev
-Jack
--
# Jack de Valpine
# president
#
# visarc incorporated
# http://www.visarc.com
#
# channeling technology for superior design and construction

Thomas Bleicher wrote:

On Thu, Mar 18, 2010 at 10:19 PM, Fitzsimmons, Rob >>>> <[email protected]> wrote:

Yes, I usually launch X11.app

Is there any harm in having all other binaries as 4.0, but keeping the rvu
3.9 version?

There should not be a big problem. But you will not be able to use the
new fancy multi-process option. I don't know if rad can pass that on
to a rvu but if it would try at some point you will get an error.

That’s working for me now. Correct me if I’m wrong but rvu is only used to
display in X11 is not used in producing an hdr image.

No. rvu is interactively producing the image. To display an image you
would use ximage. Have you tested that yet? Or glrad? I think those
are the only apps that need xlib.

Regards,
Thomas

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

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

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

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

Hi Chris,

If you haven't passed the picture through pfilt or otherwise introduced an exposure change, then it would be much faster to use pcompos to extract the value you're interested in. E.g.:

  pcompos -x 1 -y 1 rendered_image.hdr -Xpos -Ypos | pvalue -h -H -d

If getinfo shows one or more EXPOSURE= lines in the header, then the above won't quite work and you'll need to use pvalue. The syntax for the command you want is:

  pvalue -o -h -H rendered_image.hdr | rcalc -e 'eq(a,b):if(a-b+.5,b-a+.5,-1);and(a,b):if(a,b,a)' \
    -e 'cond=and(eq($1,x_location),eq($2,y_location))' -e '$1=$3;$2=$4;$3=$5'

Nasty, eh? It's also slow. Use pcompos if you can. A faster alternative to the above is to use sed:

  pvalue -o -h -H rendered_image.hdr | sed -n 's/^ *x_location *y_location //p'

Cheers,
-Greg

···

From: Chris Humann <[email protected]>
Date: April 5, 2010 4:35:52 PM MDT

My apologies for not being more specific when posting earlier. I also just realized that I missed a similar post in the archives from May 2008. However, the latter posts don't quite answer the question at hand.

I have a series of images produced from a script in which the previous image octree is over written prior to the proceeding rpict call. Given the latter condition, I don't think vwrays connected to rtrace will work as I don't have the corresponding 'octree' file.
I suppose I could write a Python Script to parse the pixel location and its associated value, but that seems a bit over kill for what seems should be a straight forward, one line task.

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

Thanks again.
Chris

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