Pcomb to mask an area of one image on to another

Greetings,

(apologies for the duplicate post which I errantly posted in haste the first time by using reply to another subject)

I’d like to write an expression within pcomb to mask the area of green trees in one HDR fisheye scene and apply those selected pixels in the same location on a second image (both images are the same resolution). Here’s an example of what I’m trying to do:
https://gyazo.com/932e7a14d64c35bff1802bcd11acc053

I’m getting close, but just can’t quite get there with the correct syntax using a threshold value for green [ex: -e 'gi(1)-thres*gi(2)’]

Thanks,
Chris

Greetings,

I’d like to write an expression within pcomb to mask the area of green trees in one HDR fisheye scene and apply those selected pixels in the same location on a second image (both images are the same resolution). Here’s an example of what I’m trying to do:
https://gyazo.com/932e7a14d64c35bff1802bcd11acc053

I’m getting close, but just can’t quite get there with the correct syntax using a threshold value for green [ex: -e 'gi(1)-thres*gi(2)’]

Thanks,
Chris

Have you tried a ratio of G:B?

-e 'thresh=2' -e
'ro=if(thresh-gi(1)/bi(2),ri(2),ri(1));go=if(thresh-gi(1)/bi(2),gi(2),gi(1));bo=if(thresh-gi(1)/bi(2),bi(2),bi(1))'

I haven't tried this syntax, but I was doing something similar recently and
it worked to use the ratio of two colors rather than an absolute.

Stephen Wasilewski
*LOISOS *+* UBBELOHDE*
- - - - - - - - - - - - - - - - - - - - - - - - - - -
1917 Clement Avenue Building 10A
Alameda, CA 94501 USA
- - - - - - - - - - - - - - - - - - - - - - - - - - -
510 521 3800 VOICE
510 521 3820 FAX
- - - - - - - - - - - - - - - - - - - - - - - - - - -
www.coolshadow.com

···

On Mon, Feb 29, 2016 at 4:45 PM, Christian Humann <chris@christianhumann.com > wrote:

Greetings,

(apologies for the duplicate post which I errantly posted in haste the
first time by using reply to another subject)

I’d like to write an expression within pcomb to mask the area of green
trees in one HDR fisheye scene and apply those selected pixels in the same
location on a second image (both images are the same resolution). Here’s
an example of what I’m trying to do:
https://gyazo.com/932e7a14d64c35bff1802bcd11acc053

I’m getting close, but just can’t quite get there with the correct syntax
using a threshold value for green [ex: -e 'gi(1)-thres*gi(2)’]

Thanks,
Chris

_______________________________________________
Radiance-general mailing list
Radiance-general@radiance-online.org
http://www.radiance-online.org/mailman/listinfo/radiance-general

Hi Chris,

Is it that your discriminator isn't segmenting the image as you would like?

It would help if you gave the full command you are using. Your expression snippet isn't a legal option to pcomb.

Cheers,
-Greg

···

From: Christian Humann <chris@christianhumann.com>
Subject: [Radiance-general] Pcomb to mask an area of one image on to another
Date: February 29, 2016 4:45:58 PM PST

Greetings,

(apologies for the duplicate post which I errantly posted in haste the first time by using reply to another subject)

I’d like to write an expression within pcomb to mask the area of green trees in one HDR fisheye scene and apply those selected pixels in the same location on a second image (both images are the same resolution). Here’s an example of what I’m trying to do:
https://gyazo.com/932e7a14d64c35bff1802bcd11acc053

I’m getting close, but just can’t quite get there with the correct syntax using a threshold value for green [ex: -e 'gi(1)-thres*gi(2)’]

Thanks,
Chris

Hi Greg and Stephen,

My discriminator was giving me odd results. Stephen’s example helped me in writing the correct expression to pcomb.

pcomb -e 'thresh=.2' -e 'ro=if(gi(1)-thresh*bi(2),ri(2),ri(1));go=if(gi(1)-thresh*bi(2),gi(2),gi(1));bo=if(gi(1)-thresh*bi(2),bi(2),bi(1))' image_1.hdr image_2.hdr > modified.hdr

Thanks for the fast responses.
Chris

···

On Feb 29, 2016, at 5:03 PM, Greg Ward <gregoryjward@gmail.com> wrote:

Hi Chris,

Is it that your discriminator isn't segmenting the image as you would like?

It would help if you gave the full command you are using. Your expression snippet isn't a legal option to pcomb.

Cheers,
-Greg

From: Christian Humann <chris@christianhumann.com>
Subject: [Radiance-general] Pcomb to mask an area of one image on to another
Date: February 29, 2016 4:45:58 PM PST

Greetings,

(apologies for the duplicate post which I errantly posted in haste the first time by using reply to another subject)

I’d like to write an expression within pcomb to mask the area of green trees in one HDR fisheye scene and apply those selected pixels in the same location on a second image (both images are the same resolution). Here’s an example of what I’m trying to do:
https://gyazo.com/932e7a14d64c35bff1802bcd11acc053

I’m getting close, but just can’t quite get there with the correct syntax using a threshold value for green [ex: -e 'gi(1)-thres*gi(2)’]

Thanks,
Chris

_______________________________________________
Radiance-general mailing list
Radiance-general@radiance-online.org
http://www.radiance-online.org/mailman/listinfo/radiance-general