[Radiance-general] pcomb-masking color channels

Santiago Torres Santiago.Torres at arup.com
Wed Apr 18 06:11:24 PDT 2012


Hi Chris,

I have used pcomb to blend different sky images that were capturing different luminance ranges. The result was never very good as the flare around the sun was always a problem.

Iebele's answer below is a great example, but please note this is merging two images (one with the sun and one with the sky) into one full sky. If you need the reverse, the command will be very similar, only that instead of using the input from the second image, you can just use a zero value.

So you can replace ri(2), bi(2), gi(2), etc. with 0, which will give you an image with only values that are above the threshold, and zero for the rest (or below the threshold, if you invert "difr=sens-ri(1)"... etc.)

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

I can imagine the cloud edge can be difficult to separate. One solution might be to use the difference between blue and red channels to try and separate the blue sky from the rest (like using a red filter, as Axel suggested, this will probably also include the circumsolar region, which can be separated in a second step). It might look something like this:

pcomb -e 'sens=0.5; dif=bi(1)-ri(1)-sens; ro=if(dif,ri(1),0); go=if(dif,gi(1),0); bo=if(dif,bi(1),0); '  full_sky.hdr   |   ximage

I've never tried something like this, so most probably there are some errors, also I have no idea what might be an appropriate threshold, but I hope this helps.
Cheers,
Santiago


From: Iebele Abel [mailto:iabel at iebele.nl]
Sent: 30 March 2012 11:51
To: Radiance general discussion
Subject: Re: [Radiance-general] pcomb-masking color channels

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<mailto: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<mailto:Radiance-general at radiance-online.org>
http://www.radiance-online.org/mailman/listinfo/radiance-general

____________________________________________________________
Electronic mail messages entering and leaving Arup  business
systems are scanned for acceptability of content and viruses
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.radiance-online.org/pipermail/radiance-general/attachments/20120418/08d03cea/attachment-0001.html>


More information about the Radiance-general mailing list