5
$\begingroup$

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:

enter image description here

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):

enter image description here

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:

enter image description here

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:

enter image description here

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?

$\endgroup$
  • 1
    $\begingroup$ Might be overkill for this, but look into Poisson blending. $\endgroup$ – pichenettes Aug 10 '12 at 13:07
  • $\begingroup$ Thanks. My project uses different algorithms and each should work "well" - so although I will probably use method based on gradient domain, the multiband blender should work as well (other software use the pyramid method as well and artifacts do not appear - this is also why I wonder where is the glitch...) $\endgroup$ – Libor Aug 10 '12 at 13:36
3
$\begingroup$

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.

$\endgroup$
  • 1
    $\begingroup$ Links are not answers. Please summarize what you found/chose. $\endgroup$ – endolith Aug 24 '12 at 21:04
  • $\begingroup$ Okay, I will leave it to later editing, maybe by someone who is interested in the problem. I am very busy to work out the elaborate answer knowing that the answer would interest hardly two people on the planet... $\endgroup$ – Libor Aug 24 '12 at 21:26
  • $\begingroup$ At least 3 :-). $\endgroup$ – Royi Sep 26 '15 at 21:43
  • $\begingroup$ @Drazick I have already edited the answer and provided solutions I found. The main solution was to add padding to the overlap area so that blending does not affect the edges. The padding is added by region growing using breadth-first search on neighboring pixels, but this is an implementation detail. $\endgroup$ – Libor Sep 27 '15 at 15:39
  • $\begingroup$ @Libor, I didn't imply you didn't. I was just saying more people are interested :-). Thank You for Sharing. $\endgroup$ – Royi Sep 27 '15 at 21:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.