CS194-26 Project 3

Kunal Munshani

Part 1

1.1 Warmup

Overview

We are given a blurry image and want to "unblur" it.

Approach

We unblur the blurry image by taking the high pass of the image to get our details. We then add a multiple of these details to unblur the image by increasing the strenght of the details.

Results on a blurry bear

Before

After

We used a gaussian with sigma 2 and added 2x the high pass details to the original image to get our result

1.2 Hybrid Images

Overview

We are given two images and want to display both of them in the same frame. One image will be visible up close and one from far

Approach

We take the high pass of one image and the low pass for another image. The high passed image retains only the details and the low passed image the general outline. The details/high passed image are visible up close and the general outline/low passed image visible from far.

Old Superman(Chris Reeves) and New Superman(Henry Cavil)

This blend turned out really well I think because the faces and posers were aligned so well. Additionaly there is little overlap in the fourier analysis of these images.

The original images and fourier analysis

The high pass and low pass images and fourier analysis

The resultant image and fourier analysis

We used a sigma for 5 for the gausian filter on both images.

The Black Mamba

Kobe and a Snake

We used a sigma for 5 for the gausian filter on both images.

This blend failed. The mamba's features seem to overpower Kobe from near. I guess this is because of the drastic color difference and the fact that this is a black and white image.

The Bigger Baller

Lonzo(Big Baller Brand) and the Rock(Baller's TV show)

We used a sigma for 5 for the gausian filter on both images.

Superman

1.3 Warmup

Overview

We apply the gaussian filter and gaussian filters multiple times to build these stacks.

Approach

We unblur the blurry image by taking the high pass of the image to get our details. We then add a multiple of these details to unblur the image by increasing the strenght of the details.

Results on Starry Night

Gaussian

Laplacian

Using a sigma of 5 for the filter and scaled by 1.5x at each step

Results on Washington crossing the Delaware

Gaussian

Laplacian

Using a sigma of 1 for the filter and scaled by 1.5x at each step

1.4 MultiResolution Blending

Overview

We are given two image and want to blend them.

Approach

We add the laplacians of the images, masked off in certain ways, together so they blend smoothly.

Orapple

This was created using a regular vertical mask. The apple's right side was masked off as was orange's right

Old eyes on a Baby

This uses a custom mask. This didn't work well, in part because the mask wasn't aligned perfectly. Also in Black and White this is a nightmarish image. On the brighside it is a smooth transition betwen the images so I wouldn't call this a failure.

Football

I blended together a football and soccerball to created the one true "football". I started with a roughly vertical mask but let the gaussian sigma be relatively large and gave many layers so it would really spread out. I might have spread too much because the images swallowed one another. The big white border is a failure case.

Here is how the ball images swallowed one another

Part 2

2.1 Warmup

Overview

Solve the least squares problem given. Use it to recreate the toy image

Approach

I made a sparse matrix to represent the A matrix for Ax = b and plugged everything into a solver.

The toy image

You got a friend in me

2.2 Poisson Blending

Overview

We are given two images. We create a mask to represnet what part we want to blend. We create this mask manually in matlab. We create a system of equation to represent a laplacian passing over our source image and solve it to get the new pixel values.

Approach

We unblur the blurry image by taking the high pass of the image to get our details. We then add a multiple of these details to unblur the image by increasing the strenght of the details.

It's a Bird, It's a Plane

The original images

This blend is much smoother than a simple copy paste.

Marvin the Martian

This one didn't quite work out because the border was too large around Marvin so we couldn't get color to blend smoothly

A Mule

This really highlights the important of positioning. With improper positioning the image ends up looking horribly wrong. On the brighside the color blend is smooth. With a better mask and some cropping this image could really look like a mule(donkey + horse)

Old eyes on a Baby Part 2

Here I'm going to compare the poisson blending to a lapplacian pyramid blending

The pyramid blend

The poisson blend

The original images

I think poisson blending generally handles color matching better than multi res. blending. However, as shown by the mars example too large of a border/mask around the image makes it hard for the color matching to work as expected. Perhaps when dealing with a larger border multi res blending does a better job.

Part 2.2 Take Aways

Having matching background colors drastically improves the images. Additionaly the images have to be positioned just right otherwise the end results looks deeply unnatural. When the borders are too large the blend suffers.

The most important thing learnt in the project

The most important thing I learnt in the project was the power of tweaking parameters. Different sigma values or border size drastically changed the end results.