CS280A Project 2: Fun with Filters and Frequencies!

Part 1: Fun with Filters

In this part, 2D convolutions and filtering are explored.

Part1.1: Finite Difference Operator

In this part, finite difference filters Dx and Dy are applied.

$$ \mathbf{D_x} = \begin{bmatrix} 1 & -1 \end{bmatrix}, \quad \mathbf{D_y} = \begin{bmatrix} 1 \\ -1 \end{bmatrix} $$

Description of the image
Figure :Original Camera Man.
Description of the image
Figure : Camera Man using Finite Difference Filters.

Part1.2: Derivative of Gaussian (DoG) Filter

Here, the noise issue observed in Part1.1 was addressed using the Gaussian filter as a smoothing operator. The 2D Gaussian kernel was obstained by generating a 1D Gaussian filter using cv2.getGaussianKernel() and then computing the outer product of this filter with its transpose. Compared the outputs, this process helps reduce the noise and provide a smoother version.

Description of the image
Figure : Blurred Camera Man using Gaussian Filter.
Description of the image
Figure : Blurred Camera Man with Finite Difference Filters.

Next, a Derivative of Gaussian (DoG) filter is applied on the original image by convolving the Gaussian filter with the difference operators Dx and Dy. The outputs from this approach is the same with the two-step process before.

Description of the image
Figure : Camera Man with DoG Filters.

Part 2: Fun with Frequencies!

Part2.1: Image "Sharpening"

For image Sharpening, I first apply a Gaussian blur (low-pass filter) to the image to get a smooth version. I then substract this blurred image from the original image to get the high frequency details. These high frequency details are amplified by a factor α and added back to the original image, enhancing the clarity of the edges and finer details.

The mathematical expession is shown below:

$$ f + \alpha \left( f - f * g \right) = (1 + \alpha) f - \alpha f * g = f * \left( \left(1 + \alpha \right) e - \alpha g \right) $$

Description of the image
Figure : Visualization of High Frequency Details.
Description of the image
Figure : Sharpened Taj Mahal.
Description of the image
Figure : Sharpened Tom and Jerry with different applied α.
Description of the image
Figure : Blurred and Re-Sharpened Running Dog (α=3).

Part2.2: Hybrid Images

The goal of this part of the assignment is to create hybrid images using the approach described in the SIGGRAPH 2006 paper by Oliva, Torralba, and Schyns. Hybrid images are static images that change in interpretation as a function of the viewing distance. The basic idea is that high frequency tends to dominate perception when it is available, but, at a distance, only the low frequency (smooth) part of the signal can be seen. By blending the high frequency portion of one image with the low-frequency portion of another, a hybrid image is created that leads to different interpretations at different distances.

Description of the image
Figure : Hybrid Derek and Nutmeg (Grayscale).
Description of the image
Figure : Hybrid Mooncake and Moon (Grayscale).
Description of the image
Figure : Frequency analysis of Moon and Mooncake processing.
Description of the image
Figure : Colorful Hybrid Mooncake and Moon.
Description of the image
Figure : Hybrid Cat with Different Face Expressions.

Multi-Resolution Blending and the Oraple Journey

The goal of this part of the assignment is to blend two images seamlessly using a multi resolution blending as described in the 1983 paper by Burt and Adelson. An image spline is a smooth seam joining two image together by gently distorting them. Multiresolution blending computes a gentle seam between the two images seperately at each band of image frequencies, resulting in a much smoother seam.

Part2.3: Gaussian and Laplacian Stacks"

A Guussian and a Laplacian stacks are implementated and applied to recreate the figure from the paper mentioned above.

Description of the image
Figure : Visualization of Apple and Orange Stacks.

Part2.4: Multiresolution Blending (A.K.A. The Oraple!)

Description of the image
Figure : Reconstruction of Laplacian Pyramid Blending Details (Burt and Adelson 1983b) using Stacks.
Description of the image
Figure : Blended USD100 with My Cat using Irregular Mask.
Description of the image
Figure : Blended Mooncake and Moon.