Part 1.1: Sharpening

To sharpen an image, we wish to boost the image's high frequencies. First, we apply a Gaussian filter, which blurs the image and gives us the low frequencies. Subtracting this away from the original image leaves the high frequencies, which we can add back to the original to get a sharpened image.
Original Sharpened

Part 1.2: Hybrid Images

We can take the low frequencies of one image and the high frequencies of another image and merge them together to form a hybrid image. When this hybrid is viewed from up close, we see the high frequencies of the second image, but from far away, we see the low frequencies of the first image. To get an image's low frequencies, we apply a Gaussian filter, and to get its high frequencies, we subtract away the low frequencies obtained by the Gaussian filter.



Some more examples:
Rao Hulk dog elephant me and me but upside down
(or me with a beard?)
poorly aligned LebronObama
As we can see with the poorly aligned LebronObama, proper alignment is necessary for a convincing effect.

Part 1.3: Gaussian and Laplacian Stacks

In a Gaussian stack, we successively blur the image more and more, filtering lower and lower frequencies. To get a Laplacian stack, we take the difference between adjacent images in the Gaussian stack to extract a band of frequencies from the image.
The leftmost images in the Laplacian stack are the highest frequencies, and the rightmost are the lowest frequencies. Thus, going left to right, we can see how Lebron transitions into Obama.

Part 1.4: Multiresolution Blending

To blend two images together, we create a 0-1 mask that tells us which part of the final image should come from which image. Directly following this mask will result in seams where the two different images meet. To remove these seams, we can Gaussian blur the mask, so each final pixel becomes a weighted average of the two original images. However, choosing a good sigma for our Gaussian blur isn't really possible, as we need a low sigma in order to preserve our images' high frequencies but a high sigma in order to seamlessly blend our images' low frequencies. Thus, we build Laplacian stacks for our two images and a Gaussian stack for our mask. The idea is that for each band of frequencies, we blend the images together with a good sigma and then combine all the bands together in the end. So higher frequencies get blended together with less blurring and lower frequencies get blended together with more blurring, preserving the details without adding any seams.
Oraple A familiar orange face Apple head



As we can see in the Laplacian stack, the higher frequencies are very sharp along the edges of the mask, while lower frequencies bleed out because the mask is blurred more.

Part 2: Gradient Domain Fusion

Gradient domain processing is another way to blend two images. Instead of copying pixels from a source image to a target image and creating seams, we will copy gradients. Thus, for every pixel inside our selected region, we want the difference between its intensity and its neighbors' intensities to be the same as the difference in intensities between the corresponding pixels in the source image. Furthermore, we want all the pixels outside the selected region to be identical to the corresponding pixels in the target image. Together, these constraints form a system of linear equations. However, there may be no solution to this system, so instead, we will try to get as close as possible using a linear least squares solver.

Part 2.1: A Toy Problem

In the toy problem, our selected region is every pixel except the top-leftmost one. By setting up the gradients for every pixel in the selected region and setting the value of the top-leftmost pixel, then solving, we obtain the original image.

Part 2.2: Poisson Blending


I didn't have to do anything special. Just align the images, draw the mask, set up the equations, and dump it into a linear least squares solver.
Some more examples:


Here the cow has a pinkish hue. This is because the background was green in the original image. Thus, the cow, being white, contains more red than its surroundings. On the moon however, the background is gray, and since the cow has more red than its background, it is now pink.
Source Target Multiresolution Blending Poisson Blending
In Poisson Blending, Steve's face has gotten redder, as with gradient techniques, it takes on the color of its surroundings. I think both types of blending work well though. We would want to use multiresolution blending when we care about keeping the original colors, and Poisson blending when we really want it to blend with its environment.