Project 3: Building a Pinhole Camera

Jesse Gao (cs194-26-afi)

Part 1

Warmup

A simple way to sharpen an image is to increase the intensity of the details. To do this, we take the original image and blur it and then subtract that from the original image in order to obtain a “mask” of all the details. We can then apply this mask to the original image, creating a sharpening effect on the final image. The blurring method used was a Gaussian blur.

original blur sharpened

Hybrid Images

In order to blend two images together, we take the high frequencies, or details, of an image and put it on top of the low frequencies of another. This way, the details will show up when viewed closely but disappear from far away.

Bells and whistles:
I decided to use color to improve the results. The color seems to work best for the low frequency component because color comes in large shades most of the time.

Derek Nutmeg
Hybrid

Below are some more hybrid examples

Smile Frown
Smirown

Dragonborn Evil Dragonborn
Hybridborn

This one failed because the images’ shades and general contours were simply too different, so it kinda just looked like bob’s face with the ghostly image of his paint slapped onto him.
Bob Ross His Painting
Bob Ross and Painting

Fouriers for the Dragonborn image

Dragonborn Evil Dragonborn

Gaussian and Laplacian Stacks

Gaussian stacks are images passed through a series of increasingly blurring filters. Laplacian stacks are the differences between each pair of consecutive Gaussian stacks.
Gaussian stack

Laplacian stack

These stacks can be used to very smoothly blend the image across multiple layers of detail.
Apple and Orange
Chrome and Firefox
They can even do irregular blend shapes
Here are the original images and the mask:
EyeGalaxyMask
These are the blended Laplacian stacks
1 2 3 4 5
This is the final result
Half Galaxy

Part 2

The Toy Problem

The task for this part is to reconstruct an image given the original image and the gradient of the original image. Constructing the gradient is a matter of solving Ax=b where x is the vector version of the image gradient and A is a sparse matrix representing the horizontal and vertical gradients and b is the actual pixel differences between two consecutive pixels in the original picture. x is easily solved for with a linear least squares solver. These are the original (left) and reconstruction (right) below.
originalreconstruction

Poisson Blending

This part takes the concept from the toy problem and applies it to images for a very smooth blending of two images as colors will be much closer when the two components are combined. Unfortunately I didn’t have enough time to complete this part so it is left blank.