Project 3

Dave Yan

Overview

We aim to find seams (horizontal or vertical) in images, and remove them for better looking resizing than scaling or cropping.

Approach

For my energy function, I used Sum of Squared Differences on R, G, and B. To calculate each pixel's energy, I use SSD on the pixels right and bottom pixel. The bottommost row of pixels have energy of 0 by default, and the rightmost column of pixels have energy of positive infinity.

Results

it appears whether an input image is real or not does not matter. Artifacts are produced if there are a lot of diagonal lines. The algorithm does a good job avoiding faces, wether it is a human's or a cat's.

Cove Image from the Paper

Original

50 vertical seams removed

50 horizontal seams removed

150 vertical seams removed

This works out pretty well, even after removing 150 vertical seams in an image that is only 500 pixels wide

Cat (taken from wallbase.cc, wallpaper number 2478736)

Original

50 vertical seams removed

50 horizontal seams removed

150 vertical seams removed

When removing vertical seams, the wall is picked to be removed, which is desirable. However, because the wall itself is so uniform, there does not appear to be much difference between seam carving and just simple cropping. Removing horizontal seams caused the cat to become squished, but I could not see any significant artifacts.

Lake (taken from wallbase.cc, wallpaper number 62049)

Original

50 vertical seams removed

50 horizontal seams removed

150 vertical seams removed

I tried another nature scene, not too many perspectives or straight lines, and the water is wavy, which caused the artifacts produced by removing horizontal seams to become harder to observe. Removing 150 vertical seams caused the right mountain to basically be cut off, but it looks decent.

Drawn Space (taken from deviantart, drawn by JoeJesus)

Original

50 vertical seams removed

50 horizontal seams removed

150 vertical seams removed

I tried a picture that is not a photo. All results turned out nicely, as the planet remained a sphere and no artifacts are evident in the nebula in the background.

Bench (taken from wallbase.cc, wallpaper number 2462738)

Original

50 vertical seams removed

50 horizontal seams removed

150 vertical seams removed

Since there are not a lot of diagonal lines, this image turned out nicely. However, after removing 150 vertical seams, it seems like some trees, such as the one in the back to the right of the bench, has its shape distorted, but it still looks like a tree so all is well.

Water Drops (taken from wallbase.cc, wallpaper number 2303426)

Original

50 vertical seams removed

50 horizontal seams removed

150 vertical seams removed

Despite the water drops everywhere, removing seams either horizontally or vertically turns out nicely. It appears all the spots that has no water drops got removed, because by the time I removed 150 seams, almost all spots have water drops on them.

Failure: Abstract Blob (taken from wallbase.cc, wallpaper number 1988633)

Original

50 vertical seams removed

50 horizontal seams removed

150 vertical seams removed

The blob has these strings coming out of it, which requires delicate alignment. Removing 50 horizontal or 150 vertical seams disrupt this, and caused them to become choppy. Removing 50 vertical seams did a good job removing everything on the left though.

Failure: Drawn Scene (taken from wallbase.cc, wallpaper number 1425140)

Original

50 vertical seams removed

50 horizontal seams removed

150 vertical seams removed

I decided to test a scenary which is drawn instead of real. Removing 50 vertical seams turns out nicely. However, removing 50 horizontal seams messed up the perspective, and caused the vanishing point to twist in a nasty way. Removing 150 vertical seams turns out decent, but the perspective lines are a bit funky.

Failure: Karlsson Selfie (taken homework website)

Original

50 vertical seams removed

50 horizontal seams removed

150 vertical seams removed

Terrible things happened. Removing 50 vertical seams causes the door to become a bit weird. Removing 150 vertical seams created significant artifacts, alhough his face remained in tact. Removing 50 horizontal seams caused the ceiling to be misaligned, and his neck is shaved away. It seems geometric shapes do not work out very well.