[Radiance-general] Insert text in Radiance images at specific location (x y z)

Greg Ward gregoryjward at gmail.com
Tue Dec 10 21:44:38 PST 2013


Hi Vaibhav,

This is probably in the archives, somewhere, but I wouldn't want the task of trying to find it myself, so I won't insist you look, either.

If you have a list of (x,y) pixel coordinates (where x is horizontal position from the left and y is vertical position from the bottom), you can use vwrays to generate rays and compute illuminance values to composite into your image.  You can generate such a list using the 't' command in ximage:

	ximage -tp myrendering.hdr > positions.txt

Just move the cursor over each place you want to compute illuminance and type 't'.  Don't expect a beep or anything, and don't hold down the 't' or you'll get a whole list of identical values when it repeats.  (If you prefer, you can click the middle mouse button instead of typing 't'.)

The list of positions can then be used in the following manner to generate illuminance values and output them via psign and pcompos:

	$ echo pcompos myrendering.hdr 0 0 \\ > pcom.sh
	$ vwrays -i myrendering.hdr < positions.txt \
		| rtrace -h [rendering options] -i+ myscene.oct \
		| rlam positions.txt - \
		| rcalc -e 'lux=47*$3+120*$4+12*$5' -o '=00 "!psign -h 25 -s -.1 ${lux}" ${$1} ${$2} \' >> pcom.sh
	$ sh pcom.sh > myluxvalues.hdr
	$ rm pcom.sh

If the text is too large or too small, adjust the psign -h value downwards or upwards as desired.

I haven't fully tested this, so I hope I didn't make any goofs.  Of course, it assumes you are using Unix.  Otherwise, you'll have more difficulty getting the quotes to work properly since Windows only allows double-quotes....

Best,
-Greg

> From: Vaib <vaibhavjain.co at gmail.com>
> Date: December 10, 2013 5:06:35 PM PST
> 
> Hello everyone, 
> 
> I wish to show illuminance values at specific locations at world coordinates (x y z) in an image. I mean, to show the illuminance values (in an orthographic image of a plan created by a camera with parallel lens) at the real position of the illuminance sensors (Rtrace/Rsensor). 
> 
> The only way I could find is to use Psign to produce text's image, and then position the produced text in the plan image by using Pcompos. Something like this: psign 100 Lux | pcompos inp.hdr 0 0 +t .5 - 200 200 > out.hdr. However, Pcompos takes input of the location of a pixel and places the text there. This is not what I intend to achieve. 
> 
> Are there other ways to do this? Thank you in anticipation. 
> 
> Best regards,
> Vaibhav Jain
> www.vaibhavjain.co



More information about the Radiance-general mailing list