Sharpening Images

I started by working on sharpening images. To do this, I boosted the high frequencies in the image. I got the high frequencies by applying a low-pass filter to the image and subtracting that from the image to get the high frequencies. Then, I added a multiple of the high frequencies to the original image to make it look sharper.

Blurry Input Dog
Sharped Output Dog

Hybrid Images

To create hybrid images, I took two different images, aligned them to overlap properly, and then combined the low frequencies from one image with the high frequencies from the other image.

In this way, when looking at the image from a distance, you see one image, and when looking up close, you see a different image.
  • Which President is he?

    Mixed Donald Trump and Barak Obama. Succesful merging that is sort of eerie actually. Has no political meaning!

  • Dat Cog

    Mixed cat with a dog.

  • Husky Alex

    Mixed me with a husky. Failure! Didn't come out quite well.

Gaussian and Laplacian Stacks

  • Gaussian Stack

    5 levels of the Gaussian stack.

  • Laplacian Stack

    5 levels of the Laplacian Stack

Multiresolution Blending

For multiresolution blending, to blend we first split the image into bands of frequencies as a Laplacian. Then, we blend at each level
  • Oraple

    Mixed orange and apple, with half-way mask.

  • An Eye in a Hand

    Non-trivial Mask used to merge photos.

  • Mountainous Mountain

    Mixed one mountain with another mountain. Half and half mask.

Laplacian Stack for Mountains

  • Mountain 1 Laplacian Stack

  • Mountain 2 Laplacian Stack

  • Output Laplacian Stack

Gradient Domain Fusion Explanation

In this part of the project, our goal is to "paste" part of a source image into a target image in a natural looking way.

We can already paste in a standard way by just copying in the values directly from the source image. However, this does not look very natural. We can be smarter about this by noting that humans actually care much more about gradients than they do about absolute values of colors.

So instead of trying to keep the original colors as close to the same as possible, we will try to minimize the difference in gradients.

We do this in two parts - one part is the gradients within the source image itself. We want those as close to the gradients in the original source image as possible, so as to keep the same edges and shapes in the image. The other part is the gradients between the edge of the source image and the target image. Here, we want the gradients to be as close to the gradients in the target image as possible, so as to blend the source image into the target image. Pixels outside of the source image (the rest of the target image) are kept at their original values.

Mathematically, we formulate this with the following minimization problem:

Toy Problem

  • Input Image

  • Solution Output Image

Poisson Blending

Shark Underwater

  • Source Image

  • Target Image

Naive Result

Gradient Domain Fusion Result

Giraffe In Snow

  • Source Image

  • Target Image

Result Image


Husky in Pool (Failure)

  • Source Image

  • Target Image

Result Image


This seems to have failed because there are way more ripples in the source image than in the target image, which gives away that they are coming from different images.

Laplacian Pyramid Reblending

  • Original Image 1

  • Original Image 2

Poisson Blending Result

Multiresolution Blending


The Poisson blending seems to do a better job here.

This is because multiresolution blending doesn't do any blending at all of the higher frequencies (the details of the mountain), and instead focuses on blending the seam of lower frequencies. Here, we need the seam to be very smooth in all frequencies.

Multiresolution blending would do better in the situation where we want each side to keep its distinct high frequencies without trying to transition from to the other.

Mixed Gradient Blending (Bell and Whistle)

For mixed gradient blending, we use the gradient with the largest absolute value (choosing between the target nd source image gradients), thereby keeping important features from the source and target.
  • Source Image

  • Target Image

Mixed Gradient Result