We aim to find seams (horizontal or vertical) in images, and remove them for better looking resizing than scaling or cropping.
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.
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.
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
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.
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.
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.
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.
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.
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.
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.
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.