1 | initial version |
If I understand you well (I'm still not sure about it), you need to do the following algorithm (this is just an outline):
1. Get the intersection of the shapes: intersect=alpha1&alpha2 (arithmetic AND operation)
2. Dilate the area using morphological operators
3. To get the yellow part, substract image1 from the result of the previous step.
Take care to use the alpha channel correctly when working with the images.