pcomb-masking color channels

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

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

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 <[email protected]>
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
[email protected]
http://www.radiance-online.org/mailman/listinfo/radiance-general

Hi Chris,

I made a mistake in last my mail, here the corrected line:

If the value is too high (not too low), the result will be just a copy of blue_sky.hdr.

Iebele

···

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

Thanks Greg and Ieble,

Iebele, that's a great start for me to play around with. Ultimately I'm trying to isolate the blue sky from white clouds in a single HDR image to get an approximation of how overcast the sky is.

Kind regards,
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, 2012, at 4:11 AM, Iebele Abel wrote:

Hi Chris,

I made a mistake in last my mail, here the corrected line:

If the value is too high (not too low), the result will be just a copy of blue_sky.hdr.

Iebele

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

I don't have anything Radiance-specific to contribute to your question. However, I've been looking at using HDR photography and the Radiance tool kit for measuring glare. To measure glare, one needs to establish the projection of the lens that is used. I've measured this for the Sigma 4.5mm that I'm using. While googling around for 'fisheye projections', I've come across this rather interesting paper:

Almost a Century of "Imaging" Clouds Over the Whole-Sky Dome.
McGuffe, K.; Henderson-Sellers, A.
Bulletin of the American Meteorological Society, vol. 70, Issue 10, pp.1243-1253

PDF at:
http://journals.ametsoc.org/doi/abs/10.1175/1520-0477(1989)070<1243%3AAACOCO>2.0.CO%3B2

It has a pretty good list of references, too.

Before digital photography and computer-based image processing, cloud detection was done by human observers. In order to obtain the best possible contrast, black and white photographs were enhanced with red filters. This is something that you might want to look at with you Radiance approach. It looks as if some of the references in that paper might give some insight into auto-detecting clouds, but I have not followed them up.

Cheers

Axel

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