[Radiance-general] pcomb-masking color channels

Iebele Abel iabel at iebele.nl
Fri Mar 30 03:50:42 PDT 2012


Hi Chris, 

I had something similar a few weeks ago, and figured out this:

pcomb -e 'sens=1.5;difr=(ri(1)-sens)-ri(2);difg=(gi(1)-sens)-gi(2); difb=(bi(1)-sens)-bi(2); ro=if(difr,ri(1),ri(2)); go=if(difg,gi(1),gi(2)); bo=if(difb,bi(1),bi(2)); '  sun.hdr blue_sky.hdr   |   ximage

You can tweak the "sens" variable to get the result you want. In my case (which was not a sky picture) the value was around 0.9 to get the result I was after. The value you need to mask the sun out of the sun.hdr image must probably be higher. If the value is too low, the result will be just a copy of blue_sky.hdr. 

The command first finds the difference between pixel values for red, green and blue in sun.hdr and blue_sky.hdr. The difference (tweaked by 'sens' ) determines from which input file the pixel component value is written to the output.

If you are only interested in changing the luminance values of blue_sky.hdr at those spots where the sun (or clouds) are bright in sun.hdr you may try something like this:

pcomb -e 'sens=1.5;difl=(li(1)-sens)-li(2);ro=if(difl, li(1)*ri(2),li(2)*ri(2) ); go=if(difl, li(1)*gi(2),li(2)*gi(2) ); bo=if(difl, li(1)*bi(2),li(2)*bi(2) );  ' sun.hdr blue_sky.hdr | image

Using these commands, the sun (and clouds) will appear with sharp boundary edges (not blurred) in the resulting composite image. 

Hope this helps a bit, 

Iebele



Op 30 mrt. 2012, om 07:45 heeft Greg Ward het volgende geschreven:

> Hi Chris,
> 
> Seems no one answered this, but I believe there are experts out there who have played with sky blending techniques.  I won't name any names, you know who you are....
> 
> I'm heading out on a little vacation tomorrow with a million things to do first, otherwise I'd take a crack at it.  Maybe you could explain a little more clearly the effect you are going for?
> 
> Best,
> -Greg
> 
>> From: Humann Chris <chris at coolshadow.com>
>> Date: March 27, 2012 3:19:15 PM PDT
>> 
>> Dear group,
>> 
>> I'd like to be able to generate two separate images from an HDR image of the sky vault: one with blue sky; the other with clouds and sun (assuming it's not occluded).  I'm not well versed in the usage of 'pcomb' but I'm assuming I'll need to somehow create a mask based on both color and brightness thresholds.  It seems from my archive search that a call to 'pgblur' with a high radius might help in defining sharper boundaries between clouds and blue sky. (http://www.radiance-online.org/pipermail/radiance-general/2008-May/005046.html)
>> 
>> Has anyone been successful in achieving something similar?
>> 
>> As always, thanks!
>> 
>> Chris
> 
> _______________________________________________
> Radiance-general mailing list
> Radiance-general at radiance-online.org
> http://www.radiance-online.org/mailman/listinfo/radiance-general

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.radiance-online.org/pipermail/radiance-general/attachments/20120330/73d2792c/attachment.html>


More information about the Radiance-general mailing list