CS194: Project 3

Franklin Heng

In this project, we focused on how frequencies and gradients play a role in image processing and image manipulation. More specifically, we were able to produce image hybrids, Gaussian and Laplacian stacks and gradient domain fusions.

Part 1.1: Warm Up

To warmup, we will be sharpening pencils! In order to do this, we subtract the original image from its smoothed version (smoothed by convolving a Gaussian filter along the original image). As a result, it will produce an image that captures the edges. From there, we will add the result to the original image to create a "sharpening effect".The following images below represent original image, sigma = 3, and sigma = 10, respectively.

Part 1.2: Hybrid Images

In the following images, we are stacking high frequency and low frequency images together to create a visual effect if at specific distances, we will see diffent images. In order to create this effect, we blur the first image, and subtract the original second image with its blurred version, and stack the modified results together.

Below, I show an example of applying the hybrid effect on two UFC fighters, who are set to fight this Saturday for the UFC light weight championship of the world. More specifically, the Russian tank, Khabib 'The Eagle' Nurmagomedov and 'The Notorious' Conor Mcregor.

The following below is the Fourier transform of the result:

Part 1.3: Guassian and Laplacian Stacks

In this portion of the project, we created Guassian and Laplacian Stacks. In order to create this we first produce the Gaussian stack, where we take an image and increase the sigma of the Gaussian filter. For my case, I begin with a sigma of 1 and double it in each level. To create the Laplacian stack, we go through the Guassian stack, and substract level i from i + 1. The last image of the Laplacian stack is the same as the last image of the Guassian stack.

The following image below is the Gaussian and Laplacian stack of Salvador Dali's Lincoln in Dalivision painting.

The folowing image below is for the Mcregor-Khabib hybrid image.

Part 1.4: Multi-Resolution Blending

In order to create a Multi-Resolution Blending, we use Gaussian and Laplacian stacks of two images and sum them together. However, when we sum we will take half of one image and half of another.

The following below is an example of the apple and orange (orapple):

The following below is an example of Mcregor and the joker from batman. The offset is off because the amount pixels that each of their face take up relative to their own image is different.:

The following below is an example of two flower breeds:

Part 2.1: Gradient Domain Fusion - Toy Problem

For the following problem, we are using gradients to blend a source image into a target image. Essentially, we are finding pixel intensity values 'v' within a source image 's' that match the known gradient values of 's'. In order to compute this we turn this into a least squares regression problem, where we represent the operations using a sparse Matrix A, which represents all the pixels within the image. The following below shows the results of the toy problem. (Left: Original, Right: Result)

Part 2.2: Gradient Domain Fusion - Poisson Blending

For the following portion, we will be taking a source image and applying it to a target image. We will use Poisson Blending to do this in a way where source image seemlessly blends into the target image. We do this by creating a mask that covers the source image and place that mask in a designated location in the target image. Within the masked region of the source image, we will compute the pixel values v that match closests with the gradients along the given image. We do this by computing the gradient for every pixel: up, down, left, and right. Once we have solved for this image, we will past this newly formed image onto the target image.

The images below shows the source image (penguin), target image (snow background), and applying the techniques of Poisson Blending.

The images below shows the source image (sunset), target image (space), and applying the techniques of Poisson Blending.

The images below shows the source image (women blowing smoking), target image (pollution), and applying the techniques of Poisson Blending.

The images below shows the source image (Floyd Mayweather's face), target image (McGregor kicking), and applying the techniques of Poisson Blending. I attempted to create an image of Conor kicking Floyd in the face. However, due to wrong allignment, differing shapes, and different coloring, you can see some artifacts in the resulting image.