Advanced Image Synthesis

> [people]
> [project]
> [examples]
> [documentation]

[people]

[project]

Our project is to implement the Algorithm presented in Lazy Snapping. As end result, we want to have a usable Program for Image Cutout.
Problems to solve are the efficient implementation of the Graph Cut algorithm, and a more seamless integration of the two phases of the algorithm. To solve those problems, we will use several of the proposed optimizations from the paper.
As Platform we will use either Java, or C++ with a Linux Windowing system. Depending on that decision, we will use a library to read images in a compressed format, and libraries for user interaction. We will implement the Graph Cut algorithm and the user assisted correction step.

[examples]

Our Plugin has shown some quite acceptable results (ok, we did try the cutouts several times...):

Image

Cutout

Woman Source Woman Cutout
Orchid Source Orchid Cutout
Fish Source Fish Cutout
Boy Source Boy Cutout
Cats Source Cats Cutout
Sommer Source Sommer Cutout

Blured Background Multiplicated

A cutout on it's own is not that usefull. But fortunately, Gimp offers a vast number of filters and edit options. The Lazy Cutting plugin creates a Mask for the layer wich is segmented. This Mask can be used to selectively apply filters to one part of the image, or to mask parts of the image.

Selective Filtering

In the first image, the mask was usesd to protect the foreground from being influenced by a motion blur filter by duplicating the layer and overlaying the masked flower. Filters can be applied to the image itself or to the mask.

In the second image, the flower was duplicated several times and shifted. The mask was slightly blured to make the seams less strong. Filtering the mask affects the composition of the images, grey pixel are partialy transparent.

The third image is composed of many cutout layers. The hat was filtered with Gimpressionist, a pseudo brush stroke generator. The shirt was heavily blured. A layer for containing the mask of the shirt and the whole person was filled with black, and it's mask was filtered with an edge detection filter to produce the outline.

[documentation]

features

Our plugin offers an easy way to cut out images in gimp. It's based on the Paper Lazy Snapping, but only implements Phase one, the coarse grain cutout. In contrast to the Paper we do that without precomputed over-segmentation, but on pixel level, which decreases our speed, but increases potential exactness.

implementation

The Algorithm that drives our software is a Graphcut Energy Minimization. We use a GPL Implementation of Graphcut, found on http://www.cs.cornell.edu/~rdz/graphcuts.html. We read the Image from Gimp, and use the User Input to find Color Distributions of foreground and background. With that information, we build a graph representation, which is solved with Graphcut. The result is written into the Mask of the Picture.

installing

Installing the Plugin requires make, gimptool and gcc. Download the source, and follow those easy steps.
terminal% unzip gimp.lazy-cutting.src.zip 
Archive:  gimp.lazy-cutting.src.zip
   creating: src/
  inflating: src/gui.cpp             
...

terminal% cd src
terminal% make
..
terminal% make install
..

using

Open a picture you want to cut out. Open the Lazy Cutting Plugin from the Plugin Menu in the Submenu Cutout. The Input Layer will be added to the current picture. Select the Pencil Tool, and mark the Background and Foreground of the Picture. Try to cover a broad range of the background and foreground colors. Then click on Apply. Calculating the Cutout can take several seconds, or even minutes.

A complete cutout can involve several iterations of marking and calculating. Once the cutout is satisfying, the mask can be used to create a selection. It can be modified, for example by a blur for a smoth cutout, or applied to hide the background.

requirements

Our Lazy Cutting Plugin requires an installed Gimp 2.0 or newer, including the Development Headers. It also uses a Graphcut Algorithm, which is included in the source tree.

[download]

The software is implemented as Gimp 2.0 Plugin, and distributed under the GPL.

Source - The SVN export of our sources. Use this.

Mac OS X Binary - The compiled Mac OS X binary. You should rather use the source.

Linux x86 Binary - The compiled Linux x86 binary. You should rather use the source.

This Page was last updated at 2006.07.07