A brief overview of seam carving

There are two stages to seam carving. First, the energy of each pixel in the image is computed. A pixel with high energy is considered important, one with low energy unimportant. There are lots of ways to determine the energy of a pixel; at the moment Seamstress uses the rate of intensity change around a pixel as its energy (see Appendix A for details). So edges end up with high energy because there is a sharp change in intensity, and large uniform areas end up with low energy. This energy function seems to work well for a wide range of images, but future versions of Seamstress will probably allow alternative energy functions to be selected or provided by the user.

Once each pixel has an energy, we can work out how to shrink the image by removing pixels with as little energy as possible. Imagine we are making an image narrower, as in Figure 2. We could sum the energies of the pixels in each column, and remove the column with the lowest total. Unfortunately this distorts the image too much. Instead we work with seams. A vertical seem is a path through the image from top to bottom, with one pixel on each row, such that pixels on adjacent rows are no more than one column distant from each other.

In practice this means a vertical seam is a wiggly line from top to bottom. There are lots of vertical seams in an image, but some are minimal vertical seams. The total energy of all the pixels in a minimal vertical seam is the lowest of any vertical seam in the image. Exactly the same idea in the other direction leads to a minimal horizontal seam. Seam carving proceeds by identifying a minimal vertical (or horizontal) seam, and removing it, leaving an image one pixel narrower (or shorter). This can be repeated as often as desired to produce an output image of any size.

Hayden Walles 2015-09-02
SourceForge.net Logo