Seam carving
From Wikipedia, the free encyclopedia
This article needs additional citations for verification. Please help improve this article by adding reliable references. Unsourced material may be challenged and removed. (July 2008) |
The introduction to this article provides insufficient context for those unfamiliar with the subject. Please help improve the article with a good introductory style. (July 2008) |
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
- ^ Shelley Powers. Painting the Web: The Fun Guide. O'Reilly Media, 2008. ISBN-13: 9780596515096; page 126
[edit] External links
- Seam carving for content-aware image resizing
- Demonstration of seam carving (Youtube video)
- Seam Carving for Content-Aware Image Resizing - from ACM Transactions on Graphics, Volume 26, Number 3, by Shai Avidan and Ariel Shamir
- ImageMagick
- Liquid Rescale, seam carving plug-in for GIMP
- Digital Image Resizer Toy, an open source implementation.
- SEAMonster, a .NET Seam Carving implementation, and open source implementation.
- Fugenschnitzer, an open source implementation.
- A pure JavaScript implementation
This computer science article is a stub. You can help Wikipedia by expanding it. |