Seamstress provides two interfaces for identifying seams in an image, as well as an way to manually protect and expose pixels of an image and a way to create a seam map from an image. The Unpicker seam interface carves seams only in one direction (only vertically, or horizontally) while the Unweaver interface allows arbitrary carving in both directions.
The interfaces provided by Seamstress
The reason two seam carvers are provided is that optimisation is possible when seam carving is in only one direction. Also, as Seamstress is currently implemented, true horizontal seam carving is much slower than vertical carving. Unpicker gets around this by performing horizontal seam carving as vertical seam carving on a transposed version of the input (that is, a version that is rotated 90 degrees and flipped).
The chief differences between the two interfaces are:
- The Unweaver interface allows arbitrary sequences of horizontal and vertical seams to be removed, the Unpicker interface allows only vertical or only horizontal seam removals.
- The Unpicker interface allows dynamic energy to be used, the Unweaver interface does not.
- Only Unpickers may be used to create seam maps.
The strategy required to use both is similar.
- Create an unpicker or unweaver the same size as the image you want to carve.
- Initialise the unpicker or unweaver with the image data.
- Compute the energy.
- Remove seams, either directly or via the Map interface.
- Perhaps obtain further information about the seam carved image (determine the size or transform coordinates).
- Delete the unpicker or unweaver.