CS 194-26 Fall 2017

Final Project

YUJIE WEN



Vertigo Shot

Overview

For this project, I duplicated the dolly zoom effect. The dolly zoom effect is created by stepping away from the subject while zooming in and vice versa so that the size and position of the subject stays consistent between shots. This creates an effect where the background either seems to approach the subject or retreat further away from the subject.

I did not have access to a dedicated camera so I used my Samsung Galaxy S7 camera to shoot the dolly zoom sequences. Images taken at higher zoom actually turned out pretty well. The following shots were taken by standing up close to the subject and slowly backing away between each shot while increasing the zoom.

The most difficult part of shooting the images was getting the subject to line up between shots. For the most part, I was able to keep the subject in relatively the same position between images by lining up certain features of the subject with parts of my display screen (ex. keeping the subject centered and consistently sized in every shot).



Images and Gif

Cat Plushie





Mini Bear Statue near Campanile





Building near Mulford Hall





Lamp Post near Li Ka Shing Center





Phone Box near West Circle

Tree near VLSB



Water Fountain near Dwinelle Hall





Focus on Miniatures

Overview

This project generates fake miniatures by simulating the tilt shift effect. In my implementation, the user starts by running the command:

python miniature.py focus_line_orientation dof_size image_name

Where focus_line_orientation is either 'V' or 'H' to designate a vertical or horizontal focus line. dof_size is a number used to define the size of the fake depth of field as a distance above and below (or left and right) of the focus line. image_name is the name of the .jpg image stored in the ./images directory used to generate fake miniature images. After the command is run, the user inputs a point on the ginput popup window to designate the location of the focus line, where the y-coordinate of the point designates the location of a horizontal focus line, and the x-coordinate designates the location of a vertical focus line. Note that since it is technically impossible to recover depth information from a 2D image, we assume that objects on the same straight line are at the same depth.

From there, a size 10 gaussian stack of the image is created, where higher levels of the stack contain increasingly blurred images. A mask of the depth of field region is created using the focus line and the inputted dof_size. This mask contains linearly increasing values from 0 to 1 the farther a pixel is from the depth of field area. The final output image is contructed using the gaussian stack and the mask. The value of the mask at any pixel location will be used to determine which level in the gaussian stack to sample from, where values of pixels farther away from the depth of field region are sampled from images higher up the gaussian stack. This causes parts of the image to be increasingly blurred the farther it is from the depth of field region. I also used the mask to alpha blend areas of the resulting image to smooth out the transitions between pixels taken from different levels of the gaussian stack. To increase the illusion of a miniature, the saturation of the final output image is increased by 70%.

Example mask and gaussian stack images of the Doe Library photo:

Image
Mask
Stack 1
Stack 2
Stack 3
Stack 4
Stack 5
Stack 6
Stack 7
Stack 8
Stack 9
Stack 10

Results

Side by side comparisons of original images and miniature images:

My photo of Doe Library
Horizontal focus line focused on the trees
Internet Photo of Tokyo Tower
Credit to Alex Chen
Vertical focus line focused on the tower
Internet Photo of Kyoto
Credit to Pedro Szekely
Horizontal focus line focused on the bridge in the image's center right region
Internet Photo of the Golden Gate Bridge
Credit to Jay Gao
Horizontal focus line focused on the bridge
Internet Photo of Positano, Italy
Credit to Robert Louden
Horizontal focus line focused on the buildings and boats on the beach
Internet Photo of Florence, Italy
Credit to Lorenzo Bianchi
Horizontal focus line focused on the buildings near the river
My photo of a street in Shinjuku, Japan
Vertical focus line focused on the lamp post
My photo of a building next to Shibuya Crossing in Japan
Vertical focus line focused on the face of the building with the brown sign