Seam Carving and Fake Miniatures

Borong Zhang     cs194-26-agb

Overview of seam carving

When resizing a picture, tradition methods like cropping and directly resizing are not adaptive to the contents -- cropping doesn't preserve integrity and resizing is not content-aware.   As introduced in Avidan and Shamir's paper, seam carving is a method for content-aware resizing and retargeting, which chooses the least important seams to remove from an image.

Results (Horizontal Carving):

Results (Vertical Carving):

Results (Failure):

I wanted to remove the sea and I first thought going through the sea has a lower cost than going through windmills.

The baby's face is distorted because it takes a large portion of the picture.

Bells & Whistles (Precomputation):

We divide the function into a precompute section and an on-line section.  For the precompute section, we use a function to precompute all the masks needed, and then, for the on-line section, we only just apply those masks on the image.


Here we compare the running time between the direct computation and precomputation method.

Original image

Direct computation (120 seams)

Time used: 75.78 sec

Precomputation (120 seams)

Time used: 0.06 sec

Bells & Whistles (different energy function):

Instead of definition energy according to derivatives found by Sobel filter, now we try Robert filter.  

Original image

Energy map corresponding to Sobel filter

Energy map corresponding to Roberts filter

Result corresponding to Sobel filter

Result corresponding to Roberts filter

Clearly, using the second energy function, the result preserves the tree better. 

Roberts filter care more about difference in diagonal directions, so if we need to remove seams that looks like a slash, it works better.

And Sobel filter cares more about x or y directions, so if there are a lot of vertical or horizontal lines, the energy function corresponding to Sobel filter will work better.

Overview of fake miniature

We create full-sized scene images resemble miniature models by just simulating the effect of selective focus cameras.  We achieve this by applying Gaussian filter on each side of a selected focus line and masking a region of interests and applying a blurring filter to the rest of the image.


Results

Pictures I took:

Images from Flickr by Kurt_mate195:

Bells & Whistles (Take a series of pictures to make a gif):