Blending Artifacts in Photo Stitching I am working on a photo stitching application that uses multi-band blending. I need to get rid of unpleasant edges appearing at some places:



Here is the area of overlap (left - new image added to the mosaic, right - current mosaic contaning pixels of new image on background pixels to improve blending, middle - blending mask):



If I just compute weighted average between left and right image according to mask, the result is of course OK. However, this would leave a visible seam as two images have usually slightly different exposure.

So all three images need to be successively blurred to build a Gaussian pyramid - here is how one level of the pyramid looks like:



You can see that the top part of blending mask "touches" the border. The Gaussian blurring filter reflects on image borders and this causes inaccuracy in lower band.

I colored the images to make the problem more visible:



I am not sure about how to blur the mask so that it would deal with overlap area edges nicely.

Few suggestions:


change behavior of the blurring filter (how?)
extend area of blending mask so that one part never "touches" the border
update weighting masks so that resulting blend mask is more "edge-aware"


Any other suggestions/hints?
I have solved this problem by adding certain padding to overlap area.

There are pixels belonging to image1, image2, background and overlap. A pixels in overlap are successively relabeled to either image1 or image2 depending on neighborhood.

This padding will make some space for the blurring so that sharp edges of the overlap have no change of appearing.

Another treat is photometric calibration, i.e. gain compensation and vignetting removal. This minimizes or even eliminates the differences in low frequency band.

Finally, the blurring have to avoid background pixels (usually black) from bleeding into the image. This can be done by alpha blending or using binary mask as described here.

It is also possible to reduce amount of blurring near edges and corners of the overlap. This, unfortunately, reduces performance of the blending algorithm and the results are somewhat uncontrolled (as the blurring is non-uniform).

Finally, a gradient domain blending improves the quality near edges as it does not rely on Gaussian blurs of fixed sizes.