Frequencies and Gradients
by Kimberly Kao
cs194-26-aas
By using the following formula, we are able to sharpen images. I used a Gaussian kernel to create blurred images.
Images:
Original
Alpha = 5
Alpha = 10
Alpha = 15
A hybrid image is one where we see Image A when we're up close but Image B when we're far away. To create a hybrid image, we low-pass filter Image A, high-pass filter Image B, and add them together. I used a 2D Guassian filter for the low-pass filter. For a high-pass filter, I subtracted the low-pass image from the original.
Derek
Nutmeg
Derek and Nutmeg
Benedict Cumberbatch
Otter
Benedict and Otter
Mark Zuckerberg
Ed Sheeran
Mark and Ed
Fourier Transform of Benedict and Otter:
Original Benedict
Original Otter
Low-pass filtered Benedict
High-pass filtered Otter
Hybrid Image
The Gaussian Stack can be made by applying the Gaussian filter at each level. The Laplacian stack can be made from taking the difference between two Gaussian layers, with the exception of the last image which should be the corresponding Gaussian image. I set an arbitrary depth of 5 for my Gaussian and Laplacian stacks.
Gaussian Stack
Laplacian Stack
Gaussian Stack
Laplacian Stack
Gaussian Stack
Laplacian Stack
Using the following multi resolution blending algorithm, we can produce images which seamlessly blend together.
Orapple
Mars and Venus
Trump with Duck Lips (irregular mask)
For this problem, we compute the x and y gradients from the image then use all the gradients, plus one pixel intensity, to reconstruct the original image. We have three constraints: 1) x-gradients of source should be similar to x-gradients of target, 2) y-gradients of source should be similar to y-gradients of target, and 3) the top left corners of the images should be the same color. We can solve these constraints by setting them up as a linear system of equations and finding the least-squares solution.
Original
Reconstructed
For this problem, we attempt to seamlessly blend image s into image v by using the following algorithm:
Below I show the source and target image, the binary mask, and final blending result (Note that the final result is a little faded because of pixel intensity normalization).
Penguin in Snow
Result
Totoro is a third wheel
Result
Doge appears in rainbow
Result
Failure case:
The image of "doge appears in rainbow" can be considered a failure. The entire bottom border of the doge is not blended well with the rainbow. This could be the result of the original doge image, which features the doge cut off at the neck. Another reason is that the rainbow colors contrast so differently with the plain doge background that the algorithm could not keep the original source pixel intensities.
Comparing multiresolution blending with Poisson blending:
Donald Duck
Using multiresolution blending
Using Poisson blending
For this particular image, the multiresolution blending worked better. A reason is that the boundaries were better blurred using the Gaussian filter, and that the pixel intensities of the duck lips were unchanged during the algorithm.