Blending and Alpha-Mask

92 views
Skip to first unread message

memecs

unread,
Oct 5, 2012, 9:53:21 AM10/5/12
to hugi...@googlegroups.com
Hello,

Could please someone explain how multiblend works in details? I am not interested in the seaming but in the actual blending steps. This is what I know.
  1. Given source images with alpha channels (mask-000.tit,mask-001.tif) crop to alpha bounding-box and in-paint empty regions. Hence image masks will have a rectangular shape.
  2. Compute NTF transform on the full  resolution final-image (resolution of the panorama).
  3. Compute 2 gaussian pyramids (inverted) on the image obtained in step 2
  4. Compute Laplacian pyramid on each individual cropped image (0-level have the resolution of the initial mask bounding-box)

Then?

I have been looking into the source-code but it's quite difficult to understand at low-level. I know the Burt algorithm but I can't really figure out, the right way to make it work correctly with alpha-channels (I get bleeding colors in the zero-alpha regions)

Thanks

mb_mask000.png
mb_mask001.png
mask-000.tif
mask-001.tif

Monkey

unread,
Oct 8, 2012, 11:40:45 AM10/8/12
to hugi...@googlegroups.com
Then...

Each image's Laplacian pyramid is mutiplied by its mask pyramid and this result is placed into a full size (and to begin with, blank) Laplacian pyramid. Shortcuts are taken where the mask is pure white or black (masks are stored and processed in a compressed format so the code is a little more complex than usual). Once all images have been processed the big Laplacian pyramid is collapsed and the result is the output image.

I'm not sure from your final sentence whether the colour bleeding is a problem you are having with multiblend (in which case can you provide a screenshot) or are you trying to implement something multiblend does in your own way? Multiblend's final output is blacked out where in those areas where all images have 0 alpha. You can disable this with --nomask but then all you should see on the outside are the inpainted parts of the source images.

Some other points:


> Given source images with alpha channels (mask-000.tit,mask-001.tif) crop to alpha bounding-box and in-paint empty regions. Hence image masks will have a rectangular shape.

I may be misunderstanding you, but this is not quite true. Only RGB in inpainted - masks retain their shape, within the image's rectangular bounding box.


  1. Compute NTF transform on the full  resolution final-image (resolution of the panorama).
  2. Compute 2 gaussian pyramids (inverted) on the image obtained in step 2
The NFT (nearest feature transform?) is performed on a map made up of those regions where only one image's mask is present. All other regions are left black to be filled by the NFT.

multiblend computes n gaussian pyramids for n images. They are only the inverse of each other when there are only two source images.

David

Federico Perazzi

unread,
Oct 8, 2012, 2:30:07 PM10/8/12
to hugi...@googlegroups.com
Hi David thanks for your explanation. I am implemented the blender myself because I will need to do some adjustments in the future.

However here I am still missing something.

Each image's Laplacian pyramid is mutiplied by its mask pyramid and this result is placed into a full size (and to begin with, blank) Laplacian pyramid.

Thus most likely at each level of the pyramid the laplacian images will be immersed into a big-black image (see attachment). So when collapsing the pyramid (leading to the final stitching), image colors wiil be blurred with the black background. Is there any way you are handling this situation?

Thanks again,
Federico




--
You received this message because you are subscribed to the Google Groups "Hugin and other free panoramic software" group.
A list of frequently asked questions is available at: http://wiki.panotools.org/Hugin_FAQ
To post to this group, send email to hugi...@googlegroups.com
To unsubscribe from this group, send email to hugin-ptx+...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/hugin-ptx

example.jpg

memecs

unread,
Oct 8, 2012, 10:39:22 PM10/8/12
to hugi...@googlegroups.com, federico...@gmail.com
Nevermind I figured that out. Thanks a lot again for your help.

Best,
Federico

Monkey

unread,
Oct 9, 2012, 11:32:04 AM10/9/12
to hugi...@googlegroups.com, federico...@gmail.com
Ah, I see where the confusion arises (and maybe you do too if you have figured it out!)

multiblend assumes that the edges of an image, once inpainted, extend out to infinity.
Reply all
Reply to author
Forward
0 new messages