Seam carving

From Wikipedia, the free encyclopedia

Jump to: navigation, search

Seam carving, sometimes referred to as content aware image resizing, is an algorithm for image resizing (primarily shrinking) developed by Shai Avidan and Ariel Shamir.[1]

It seeks to avoid the drawbacks of other approaches to image resizing like cropping (where parts of the image are cut away in order to reduce the image size) and image scaling (which distorts the image contents if not done both horizontally and vertically by the same factor).

Seam Carving operates on "seams", i.e. sequences of orthogonally or diagonally adjacent pixels that run from one side of the image to the other, one per column (horizontal seams) or one per row (vertical seams). Removing all pixels in a seam reduces the height or width of the image by one row or column; repeated selection of seams to remove can achieve any amount of shrinking. Seam carving can be adapted to image enlargement by duplicating the pixels in a seam.

Results can be controlled by selecting seams; Avidan and Shamir adopted dynamic programming to extend the "best" seam starting at every pixel of an image edge, according to an "importance" function that represents the penalty for removing each pixel.

The importance of a pixel is generally estimated by its contrast when compared with its neighbor pixels, but other measures may be used.

Additionally, it's possible to manually define protected areas in which pixels may not be removed (e.g. to leave important subjects untouched and affect background pixels only), or conversely to designate pixels that must be deleted (e.g. to remove whole objects from photographs along with an automatically computed part of the background).

It is possible with seam carving to scale pictures by a larger amount while still retaining details. In normal image scaling, scale factors greater than 2 or less than 0.5 usually result in visible image quality degradation. Seam carving artefacts usually consist of deformed objects (whenever seams are not uniformly distributed: smoother textures are deleted first) or of visibly damaged details (where seams affect high contrast areas).

[edit] References

  1. ^ Shelley Powers. Painting the Web: The Fun Guide. O'Reilly Media, 2008. ISBN-13: 9780596515096; page 126

[edit] External links

Personal tools
Languages