Final Project

CS 194-26 Computational Photography Fall 2018

Guowei Yang  cs194-26-acg 

Introduction

In this project, we will be implementing a really cool image cropping technique, which is called seam carving. Imagine the scenario where you want to crop the image due to the size being too big, but don't want loose the main objects in the scene. A powerful scheme is to use Seam Carving, a.k.a. content-aware image resizing.


Original Image

Direct Crop

Direct Shrinking

Seam Carving

Defining Energy Function

During carving, we want to remove the pixels that don't "stand out" in their surroundings. We thus define an "Energy Function" that describes how "significant" a certain pixel contributes to its environment. In my case, I simply choose the square difference of the pixel's RGB value and it's neighbors'. The energy function I used is as follows:

After getting the energy of the entire image, we use dynamic programming to find a path that leads to the least amount of  total energy increase. This well be the seam that we are interested in removing.

Finding the Seam

After getting the energy of the entire image, we use dynamic programming to find a path that leads to the least amount of  total energy increase. This well be the seam that we are interested in removing.

Once we obtain the seam, everything is trivial: we simply remove the pixels that lies on the seam, and merge the rest of the images together. We got some really stunning results for doing seam carving, which is shown as follows:

Results

Avengers: Infinity War Poster

Bugatti Chiron

The Campanile

CS 61A Midterm Exam

San Francisco Night

Yosemite Upper Fall

Wheeler Hall

Yosemite Valley

Failure Cases

Sometimes when we remove too many pixels, artifacts will show up, such as:


Thoughts

From this project, I have learned the power of pixel-level image manipulation. Seam carving is such a powerful tool that could help user resize a given image. For most of the results, if the number of pixels are large enough, we have plenty of space to resize the image without producing any artifacts.





Pt. 1 - Seam Carving

Introduction

In this project, we will be implementing a really cool image cropping technique, which is called seam carving. Imagine the scenario where you want to crop the image due to the size being too big, but don't want loose the main objects in the scene. A powerful scheme is to use Seam Carving, a.k.a. content-aware image resizing.


Pt. 2 - Vertigo Shot (Dolly Zoom)

Bells & Whistles

Procedure

The basic procedure we have followed is that we want to zoom in the object while moving far from the object we are shooting.

Other Thoughts

We used a Sony Mirrorless camera to take the vertigo shots. We also used a tripod to stablize our shot, as well as making sure the angle and height of the camera is consistent across all shots. One of the difficulties we have encountered is keeping the objects the same size in the frame. It appears that it's very hard to keep it the same size perfectly, which will greatly affect the vertigo shot.