[Radiance-general] Rcalc if(cond,then,else)

Greg Ward gregoryjward at gmail.com
Wed May 30 13:37:02 PDT 2012


Hi Chris,

The "pcomb" program was built for this kind of thing.  Try:

	pcomb -e 'lo=if(0.6*bi(1)-ri(1),0,1)' input.hdr | ra_tiff -b - black_white.tif

I didn't use a ratio so as to avoid divid-by-zero errors, and converted the (monocrhome) output to TIFF.

-Greg

> From: Humann Chris <chris at coolshadow.com>
> Date: May 30, 2012 12:08:11 PM PDT
> 
> Dear list,
> 
> I'd like to use Pvalue to pipe an image in to Rcalc and divide each pixel's Red value by its Blue value.  If the latter ratio is greater/equal to .6 then I'd like make the given pixel white and if not then black.  I'm using the following Pvalue command:
> pvalue -o -h -H image.hdr
> 
> The if(cond,then,else) function is eluding me
> 
> Thanks as always.
> 
> Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.radiance-online.org/pipermail/radiance-general/attachments/20120530/a470052b/attachment.html>


More information about the Radiance-general mailing list