15-463 Fall 2007: Project 2
Seam-based Image Carving

Method

As described in this paper.

Remarks

Initially, I used an energy function that was simply shift-and-subtract in the x and y directions, to get a pixel-to-pixel derivative. This yielded some bad results in some edge cases, so I moved to a Laplacian-of-Gaussian filter:

energy = imfilter(image, fspecial('log', 5, 0.5));

Click on any image to see a full-size version.

Successful


This image got worse using the LoG energy function, so I kept the results from the naive implementation. Note that the boat and the high-rise on the left stay roughly the same size.

Source

The yellow building in the center retains most of its detail.

Source

The Space Needle and the high-rise to its right make it through unscathed. The boat experiences some minor problems on its left side.

Source

The rock and the plants are almost untouched.

Source

The shelter and the grass stay mostly the same, though the shelter does get a bit flattened. Notice the sky above the structure is slightly compressed, since all of the seams went through that space.

Source

The algorithm decided Morewood Gardens (the brick building in the center of the original photograph) was unimportant. I don't know that I disagree.

Source

Despite a little waviness, straight lines are still relatively well preserved in this image. The results were much worse under the shift-and-subtract energy function because its sensitive to diagonal edges was less than the LoG's.

Source

Less than successful


The globally uniform but locally choppy water was seen as a high-energy region, such that the retargeting algorithm hesitated to remove anything from it until very late in the game. The sky, however, was seen as very low-energy, except for that pesky Space Needle. The cost of cutting through the pride of the 1962 World's Fair was evidenty much less than that of cutting through the water. Manual correction to make the Space Needle artificially energetic might fix this problem.

Source

Obviously, the sky was a tempting target for the retargeting algorithm. However, it had to find some way to get from the sky through to the ground; the way it chose was through the relatively dark door to Hamerschlag Hall. Enough of the seams went through roughly the same point that the Hamerschlag Hall facade was basically eliminated from the photo.

Source

Impressionist


In this image, I removed 50 pixels in the X direction, then 50 pixels in the Y direction, etc., until I had removed 400 pixels in each direction. Because so many of the "low-energy" pixels were removed, those that remain form something of a caricature of the original image, with its details almost grotesquely emphasized. Overall, a pretty cool effect.

Source