## How to obtain union of two RGB Images of same size ?

### Anand (view profile)

on 22 Sep 2014
Latest activity Commented on by Anand

on 1 Oct 2014

### Image Analyst (view profile)

I have two rgb images. How to obtain union of this two images ? I'm getting error if i use union command as it is operable to vectors.

Image Analyst

### Image Analyst (view profile)

on 25 Sep 2014
That's not an RGB image - that's a 5 dimensional array! And I think Geoff asked you first what was meant by union. Do you want just the average?
Anand

### Anand (view profile)

on 26 Sep 2014
Sir i'm not going for average or any concatenation, i just want to know what does '∪' does between two images at certain pixel locations. I saw this symbol used in a journal paper between two images ?
if i read an (RGB) image say
and let say image size is 600 x 600 x 3
after this step if i type in matlab command window as below
I(1,1,:,:,1)
i will get R, G & B values at pixel (1,1); ie (x,y)
Anand

### Anand (view profile)

on 26 Sep 2014
I agree it's not an RGB image, I(x,y,:,:,1) will represent only pixels value at point(x,y). My aim is to find what ' ∪ ' means & how to use it between two images. I have attached the journal paper. In the shadow removal techniq if you see the last step (formula) they have used the symbol ' ∪ ' . any help on this ?

### Image Analyst (view profile)

on 26 Sep 2014

For each spectral band, it finds a binary image that says whether an image is considered shadow or non shadow. It then processes the shadow regions to brighten them, and also does some adjustment of the non-shadow/bright regions to normalize their intensity. Then it combines them so that the pixels in the new, improved image are either the improved shadow pixel, or the improved bright pixel, depending on what they started out as. In essence
binaryImage = output of their Otsu-based algorithm
improvedShadowRegion = algorithm applied to pixels defined by binaryImage
improvedBrightRegion = algorithm applied to pixels defined by inverse of binaryImage
That makes each pixel either the improved bright or shadow value, depending on what class (bright or shadow) it started out as. It doesn't look like they do any feathering/blending of the borderlines between the bright and shadow regions.

Anand

### Anand (view profile)

on 1 Oct 2014
Hi sir, I have developed code for above paper, and getting little improvement in shadow region brigtness. but not as accurate as in paper. any modifications for this code ?. I have attached the code & images
Image Analyst

### Image Analyst (view profile)

on 1 Oct 2014
No, sorry. I just don't have the time to dig into it. Did you ask the authors of the paper for help?
Anand

on 1 Oct 2014
ok

### Thorsten (view profile)

on 26 Sep 2014
Edited by Thorsten

### Thorsten (view profile)

on 26 Sep 2014

The symbol '∪' is used in the paper to denote that the original image is the union of two images, one with shadows, the other without shadows. Once you have the binary mask M that divides the image into these two parts, you can use something like