Pyramid Blending
Representing an image as a pyramid has a number of uses in image processing. The general process is to downsize and blur an image multiple times creating a stack (or pyramid) of images each at a lower resolution.
The resulting pyramid can be used for things such as object recognition at different scales and certain types of compression.
In this application an image pyramid is used to create a blended image. The smaller and more blurry images in the pyramid serve as a low-pass filtered version of the image. A stack of these images form what is known as a "Gaussian pyramid".
White input image pyramids
Mask image pyramids
Black input image pyramids
The Gaussian pyramid can be used to create a high-pass filtered version of the image known as a "Laplacian pyramid". The formula for a Laplacian pyramid at a level $i$ is given as:
$$ \begin{aligned} L_{i} = G_{i} - (K * G_{i}) \end{aligned} $$
Where $K$ is the downsize and blur operator and $G_{i}$ represents an image from the Gaussian pyramid at level $i$. Expanding and adding images from the Laplacian pyramid can recreate the original image with no data loss.
Effectively this means that a wider blend region can be used in low-frequency content and a narrower blend region can be used in high-frequency content such as edges.
White input image pyramids
Mask image pyramids
Black input image
This technique can be used to avoid a halo effect in images which make blend regions more noticeable.
This project implements the academic papers:
-
Both of which were authored by Peter Burt and Edward Adelson
Blended image of a Quagga
Result blended image
Result blended image