Final Programming Project: The Vertigo Shot and Fake Miniatures

Fake Miniatures

This pre-canned assignment appealed to me because I had seen before a video of a series of photographs taken with the tilt shift effect, which made the entire scene look as if they were toys or miniatures. I had always wondered how exactly the effect was done, so I wanted to be able to replicate it with code.

The assignment was essentially broken down into three parts.

  • Defining the focus line
  • Creating a fake depth of field
  • Adjusting the colors
  • Focus Line

    To create the focus line, I selected two points in the image. Since two points are needed for a line, I used the x and y coordinates of the two points to construct a line. Then, with the line's m and c values, I could determine what other points in the image lay on or to a certain radius around the line in order to create the fake depth of field in the next step.

    Depth of Field

    Since the image was not actually taken with the depth of field we are trying to create, I used a Gaussian blur filter from a previous project in order to blur the background and fake this depth of field. The desired effect is for the image to be increasingly more blurred the further a point is from the focus line. To accomplish this, I used a series of masks that were centered on the focus line, but increased in size. By repeatedly masking and blurring the image, I could get a gradual increase of the Gaussian blur the further I was from the focus line. Below are examples of the expanding masks.

    Small area of focus
    Medium area of focus
    Large area of focus

    Adjusting color

    After creating an image with the desired fake depth of field, to make the miniature effect more prominent, I adjusted the saturation of the image. To do this, I converted the rgb image into an hsv format so I could increase the saturation channel of the image by 75%. The resulting image looks more whimsical and toy-like.

    Before Color Adjustment
    After Color Adjustment

    Before and After Results

    Image by Pedro Szekely - Before
    Image by Pedro Szekely - After
    Image by Håkon Skogsrud - Before
    Image by Håkon Skogsrud - After
    Berkeley benches - Before
    Berkeley benches - After
    Southern California beach - Before
    Southern California beach - After
    San Francisco- Before
    San Francisco- After
    Taipei- Before
    Taipei- After

    (pictures aside from the first 2 taken by me)

    From this assignment, my favorite photo results are the pictures of the Southern California beach and the picture of Japan taken by Håkon Skogsrud. This is mostly because the subjects of the picture are quite small in comparison to the scenery around it, so the effect is clearer. Although the effect was not difficult to implement code-wise, I thoroughly enjoyed looking at the results of the project, and was surprised at how effective it was given that I was only adding blurring and color changes.

    The Vertigo Shot

    I've been a pretty avid photographer in college, so it's always interesting to me when I learn new techniques to use on my DSLR. The Vertigo shot camera movement creates an interesting effect called the dolly zoom that undermines normal visual perception. To create this effect, I took several photos of the same subject. Though the subject does not move, with each photo I backed up and zoomed in with the camera so that the subject stays the same size in the photo. Below are some examples.

    Here you can see that although the main subject (a catbug plushie) stays the same size in the frame, the background changes became of how far I'm standing and how much I'm zooming in to the subject. When all the images are combined together as a gif, it seems as if the subject is moving rather than the camera person.