Project 2

Overview

For this project, we experiment with low-pass and high-pass filtering to sharpen blurry images and to also display hybrid images which appear differently when viewed close or at a distance. Further, we use Gaussian and Laplacian stacks, which contain different levels each of which encodes information about the frequencies that make up an image. Then, we can apply a mask at each level to integrate two images together seamlessly.

Filters

Finite Difference Operator

Using the finite difference operators, convolve the image with each derivative filter to obtain the partial derivatives with respect to x and y. Then, the gradient is simply the vector whose first component is the partial derivative along x and second component is the partial derivative along y. Of couse, we cannot plot this as an image, so we take its magnitude (Euclidean norm) and make an image. The magnitude gradient image has the edges of the original image.

Derivative wrt to x-axis Binarized partial derivative
Derivative wrt to y-axis Binarized partial derivative
Gradient Binarized Gradient

Derivative of Gaussian (DoG) Filter

Blur the image with a low-pass filter, a Gaussian kernel, and then compute the derivatives of the image. The results below are clearly much better than those above due to the low-pass filter removing noise in the images which the filters above picked up as "edges". By smoothing, we ignore these fake edges but still preserve the original edges.

Derivative wrt to x-axis Binarized partial derivative
Derivative wrt to y-axis Binarized partial derivative
Gradient Binarized Gradient

Make a single filter, by taking the derivative of the Gaussian kernel which is the convolution of the kernel with each difference operator, and then convolve with the image.

Derivative wrt to x-axis Binarized partial derivative
Derivative wrt to y-axis Binarized partial derivative
Gradient Binarized Gradient

Compare the second and third images. They're almost identical.

Binarized Gradient, low-pass then derivatives Binarized Gradient, derivative of low-pass

Image "Sharpening"

Note that the landscape image below is very blurry, but the sharpening does quite a decent job at recovering details such as some of the branches in the top left and the shape of the trees.

Taj Mahal Sharpened
Landscape Sharpened

Blur an image and then resharpen. The differences between these two is that there are noticeable "grains" of the sharpened image. But it does look much better when compared to the blurred image.

Chichen Itza
Blurred Original Sharpened

Frequencies

Hybrid Images

Happy Hank Angry Hank Season 5 Episode 8

The images with Hank made for the best result. Below are the frequency domain images. Note that the original two images have very similar frequency representation because they are very similar in the spatial domain.

Frequency of Happy Filtered Frequency of Happy (High-Pass)
Frequency of Angry Filtered Frequency of Angry (Low-Pass)
Frequency of Hybrid

Other images.

McLaren F1 La Ferrari F1 World Champions
Happy Sad Saddy?
Me Rex Joe in the 501st (Failure)

Gaussian and Laplacian Stacks

Orapple Stack The Orapple

Multiresolution Blending

Boeing 777 Airbus 350
Mask Boeing 350

The mask used for this image is a simple left-half plane, similar to the one shown in the orapple stack.

IRL couch Lego Ahsoka
Ahsoka Mask Lego Ahsoka IRL

Below, note that the mask image is taken directly from the source image. However, my implementation increases the size of the mask image so that it's identical to the size of the larger image of the Bay Area.

Bay Area Star Destroyer
Mask Long Live the Empire