<p>I will first go through some general links and resources and then try to describe the general idea of the algorithm.</p>

<p><strong>SEEDS implementations:</strong></p>

<p>You obviously already saw the documentation <a href="http://docs.opencv.org/3.0-beta/modules/ximgproc/doc/superpixels.html" rel="noreferrer">here</a>. A usage example for OpenCV's SEEDS implementation can be found here: <a href="https://github.com/Itseez/opencv_contrib/blob/6cd8e9f556c8c55c05178dec05d5277ae00020d9/modules/ximgproc/samples/seeds.cpp" rel="noreferrer">Itseez/opencv_contrib/modules/ximgproc/samples/seeds.cpp</a>, and allows to adapt the number of superpixels, the number of levels and other parameters live - so after reading up on the idea behind SEEDS you should definitely try the example. The original implementation, as well as a revised implementation (part of my bachelor thesis), can be found on GitHub: <a href="https://github.com/davidstutz/superpixels-revisited/tree/master/lib_seeds" rel="noreferrer">davidstutz/superpixels-revisited/lib_seeds</a> and <a href="https://github.com/davidstutz/seeds-revised" rel="noreferrer">davidstutz/seeds-revised</a>. The implementations should be pretty comparable, though.</p>

<p><strong>Publication and other resources:</strong></p>

<p>The paper was released on arxiv: <a href="http://arxiv.org/abs/1309.3848" rel="noreferrer">arxiv.org/abs/1309.3848</a>. A somewhat shorter description (which may be easier to follow) is available on my website: <a href="http://davidstutz.de/efficient-high-quality-superpixels-seeds-revised/" rel="noreferrer">davidstutz.de/efficient-high-quality-superpixels-seeds-revised</a>. The provided algorithm description should be easy to follow and -- in the best case -- allow to implement SEEDS (see the "Algorithm" section of the article). A more precise description can also be found in my <a href="http://davidstutz.de/wordpress/wp-content/uploads/2014/09/thesis.pdf" rel="noreferrer">bachelor thesis</a>, in particular in section 3.1.</p>

<p><strong>General description:</strong></p>

<p><em>Note that this description is based on both the above mentioned article and my bachelor thesis. Both offer a mathematically concise description.</em></p>

<p>Given an image of with width <code>W</code> and height <code>H</code>, SEEDS starts by grouping pixels into blocks of size <code>w x h</code>. These blocks are further arranged into groups of <code>2 x 2</code>. This schemes is repeated for <code>L</code> levels (this is the number of levels parameter). So at level <code>l</code>, you have blocks of size</p>

<pre><code>w*2^(l - 1) x h*2^(l - 1).
</code></pre>

<p>The number of superpixels is determined by the blocks at level <code>L</code>, i.e. letting <code>w_L</code> and <code>h_L</code> denote the width and height of the blocks at level <code>L</code>, the number of superpixels is</p>

<pre><code>S = W/w_L * H/h_L
</code></pre>

<p>where we use integer divisions.</p>

<p>The initial superpixel segmentation which is now iteratively refined by exchanging blocks of pixels and individual pixels between neighboring superpixels. To this end, color histograms of the superpixels and all blocks are computed (the histograms are determined by the number of bins parameter in the implementation). This can be done efficiently by seeing that the histogram of a superpixel is just the sum of the histograms of the <code>2 x 2</code> blocks it consists of, and the histogram of one of these blocks is the sum of the histograms of the <code>2 x 2</code> underlying blocks (and so on). So let <code>h_i</code> be the histogram of a block of pixels belonging to superpixel <code>j</code>, and <code>h_j</code> the histogram of this superpixel. Then, the similarity of the block <code>j</code> to superpixel <code>j</code> is computed by the histogram intersection of <code>h_i</code> and <code>h_j</code> (see one of the above resources for the equation). Similarly, the similarity of a pixel and a superpixel is either the Euclidean distance of the pixel color to the superpixel mean color (this is the better performing option), or the probability of the pixel's color belonging to the superpixel (which is simply the normalized entry of the superpixel's histogram at the pixel's color). With this background, the algorithm can be summarized as follow:</p>

<pre><code>initialize block hierarchy and the initial superpixel segmentation
for l = L - 1 to 1 // go through all levels
    // for level l = L these are the initial superpixels
    for each block in level l
        initialize the color histogram of this block
        // as described this is done using the histograms of the level below
// now we start exchanging blocks between superpixels
for l = L - 1 to 1
    for each block at level l
        if the block lies at the border to a superpixel it does not belong to
            compute the histogram intersection with both superpixels
            assign the block to the superpixel with the highest intersection
// now we exchange individual pixels between superpixels
for all pixels
    if the pixel lies at the border to a superpixel it does not belong to
        compute the Euclidean distance of the pixel to both superpixel's mean color
        assign the pixel to the closest superpixel
</code></pre>

<p>In practice, the block updates and pixel updates are iterated more than ones (which is the number of iterations parameter), and often twice as many iterations per level are done (which is the double step parameter). In the original segmentation, the number of superpixels is computed from <code>w</code>, <code>h</code>, <code>L</code> and the image size. In OpenCV, using the above equations, <code>w</code> and <code>h</code> is computed from the desired number of superpixels and number of levels (which are determined by the corresponding parameters).</p>

<p>One parameter remains unclear: the prior tries to enforce smooth boundaries. In practice this is done by considering the <code>3 x 3</code> neighborhood around a pixel which is going to be updated. If most of the pixels in this neighborhood belong to superpixel <code>j</code>, the pixel to be updated is also more likely to belong to superpixel <code>j</code> (and vice versa). OpenCV's implementation as well as my implementation (SEEDS revised), allow to consider larger neighborhoods <code>k x k</code> with <code>k in {0,...,5}</code> in the case of OpenCV.</p>
superpixels extracted via energy-driven sampling (SEEDS)
<p>I am interested in superpixels extracted via energy-driven sampling (SEEDS) which is a method of image segmentation using superpixels.  This is also what OpenCV uses to create superpixels.  I am having troubles finding documentation behind the SEEDS algorithm.  OpenCV gives a very general description which can be found <a href="http://docs.opencv.org/3.0-beta/modules/ximgproc/doc/superpixels.html" rel="nofollow">here</a>.  </p>

<p>I am looking for a more in depth description on how SEEDS functions (either a general walk through or a mathematical explanation).  Any links or thoughts concerning the algorithm would be much appreciated! I can't seem to find any good material. Thanks!</p>