Project 7: The Vertigo Shot and Seam Carving

Ashley Chen

The Vertigo Shot

Duplicating the shot

In this project, I attempted to repicate "the vertigo shot", or the dolly zoom, made famous by the Hitchcock movie Vertigo. This shot creates a trippy effect by moving the camera further from the subject while simultaneously zooming in to change the field of view, keeping the subject at a constant size. This makes it look like the background is changing while the subject is staying the same. Here are two series of photographs I took to duplicate this effect. I shot these using a Canon Rebel T3i DSLR.

These pictures of my water bottle were taken on the ground of the hallway of Valley Life Science Building, next to the library. In order to keep the camera as stable as possible and level with the bottle (I did not have a tripod), I crouched on the floor to take the pictures. To ensure that the water bottle (the subject) stayed a constant size with the many pictures I took, I used the guiding grid lines on the camera's view finder preview screen and made sure the subject was always the same size based on the lines. I also had to refocus every time I moved the camera since the distance to the subject had changed.

These pictures of my sunglasses were taken inside Valley Life Science Building Library. This time, to keep my subject and camera stable, the glasses were placed on a table and the camera was placed on a rolling cabinet that I

Bells and Whistles

I assembled the sequences I took into animated gifs.

Here are two sequences of the same subject and background. The first sequence is taken the same way as my other sequences, in which we move the camera further from the subject and zoom in to keep the subject's size the same. The second is taken with a different method, where we move the subject further from the camera (which stays in the same place) and zoom in to keep the subject the same size. The result of moving the subject is not as satisfying as that of moving the camera. Because the subject is moving the sequence looks more like a stop motion of the subject moving backwards (which they are) rather than the background changing around the subject. Another interesting effect of moving the subject is the possibility of the lighting changing as the subject moves relative to the light sources.

Moving the camera

Moving the subject

Here are gifs of those two sequences

Seam Carving

Seam Carving is a technique used to resize images along one axis by repeatedly deleting "seams" in a picture. The paper by Avidan and Shamir describes a seam as a "connected path of low energy pixels in an image". I like to think of this as the least important line in the picture. To find this seam vertically, I used the sobel filter to get the gradients of the image, while setting the borders' gradients to a higher value (so it doesn't just start cropping the image to resize) and used this as the energy matrix of an image. To find the seam of lowest energy, I created a cumulative matrix that holds for each coordinate x, y, the energy of path from the top to get to that coordinate that results in the minimum energy. Once this cumulative matrix is constructed, finding the seam just involves tracing back the minimum energies from the index of the minimum in the bottom row. Then, to shrink an image along the x-axis by n pixels simply requires removing the least important seam n times. To extend the algorithm to resize in the y-direction with horizontal seams, I just transpose the image, resize it with vertical seams, and then transpose the image again. Below are several instances of resizing images using seam carving. Pictures I didn't take myself are credited.

Image from http://peanutpaws.com/assets/uploads/2016/03/can-dogs-drink-milk-300x300.jpg



































Failure Cases

Enjoy a few not so successful seam carving resizings. I notice that this happens often when there are people's faces in the picture or a lot of different details. When proportions matter a lot to the picture's effect, seam carving doesn't do such a good job resizing because the proportions get lost and things end up looking very stretched out. The deleted seams might also leave some lines end up not connecting quite as well as they were before deletion.









This almost looks like a snapchat filter









Why did everyone wear black???







Fruit and lines getting choppy From https://i2.wp.com/farmtotablepa.com/wp-content/uploads/2010/11/local-fruit-bowl.jpg?resize=300%2C300







Self Reflection

This project was really cool because a very simple algorithm can be so powerful and actually meaningfully resize images. It worked especially well on sweeping landscapes and it's surprising how smoothly simply deleting pixels in each row can resize pictures. The most important thing I learned from this project was that the best method for image compression really depends on the method itself and the composition of the original image.