What is a superpixel?
This presentation describes Superpixel algorithms such as watershed, mean-shift, SLIC, BSLIC (SLIC superpixels based on boundary term)
references:
[1] Luc Vincent and Pierre Soille. Watersheds in digital spaces: An efficient algorithm based on immersion simulations. IEEE Transactions on Pattern Analysis and Machine Intelligence, 13(6):583–598, 1991.
[2] D. Comaniciu and P. Meer. Mean shift: a robust approach toward feature space analysis. IEEE Transactions on Pattern Analysis and Machine Intelligence, 24(5):603–619, May 2002.
[3] Radhakrishna Achanta, Appu Shaji, Kevin Smith, Aurelien Lucchi, Pascal Fua, and Sabine Süsstrunk, SLIC Superpixels Compared to State-of-the-art Superpixel Methods, IEEE Transactions on Pattern Analysis and Machine Intelligence, vol. 34, num. 11, p. 2274 - 2282, May 2012.
[4] Radhakrishna Achanta, Appu Shaji, Kevin Smith, Aurelien Lucchi, Pascal Fua, and Sabine Süsstrunk, SLIC Superpixels, EPFL Technical Report no. 149300, June 2010.
[5] Hai Wang, Xiongyou Peng, Xue Xiao, and Yan Liu, BSLIC: SLIC Superpixels Based on Boundary Term, Symmetry 2017, 9(3), Feb 2017.
4. WHAT IS A SUPERPIXEL?
A superpixel can be defined as a group of pixels which have similar
characteristics.
4
5. ADVANTAGES OF SUPERPIXEL
1. Good adherence to object boundaries
2. reduce the computational complexity from thousands of pixels to a few
hundred superpixels
5
9. WATERSHED ALGORITHM
9
• Any grey image can be considered as a topographic surface.
• flood this surface from its minima
• prevent the merging of the waters coming from different sources
Watershed algorithm was proposed by Vincent and Soille in 1991 Watershed lines
10. WATERSHED ALGORITHM
10
Watershed algorithm might be used on the gradient image instead of the original image.
Gradient imageOriginal image
Watershed of the original imageWatershed of the gradient image
11. WATERSHED ALGORITHM
11
in practice, this algorithm produces an over-segmentation due to noise or local irregularities in
the gradient image.
13. MEAN-SHIFT ALGORITHM
13
1. Choose a search window size.
2. Choose the initial location of the search window.
3. Compute the mean location (centroid of the data) in the search window.
4. Center the search window at the mean location computed in Step 3.
5. Repeat Steps 3 and 4 until convergence.
Mean-shift algorithm was proposed by Comaniciu and Meer in 2002
23. SLIC ALGORITHM
Simple Linear Iterative Clustering (SLIC) algorithm
24
The Simple Linear Iterative Clustering (SLIC) algorithm was proposed by Radhakrishna Achanta in 2010
28. COVERT RGB TO LAB COLOR SPACE
B channel
Blue-yellow
A channel
Red-green
L channel
29
RGB
29. SLIC EXAMPLE
30
• Each pixel is assigned a 5-valued vector
(𝑋, 𝑌, 𝐿, 𝑎, 𝑏) for position and color
• Number of pixels: 𝑁 = 1600
• Image size: 40×40
• Number of superpixels: 𝐾 = 16
30. THE MAIN STEPS OF THE SLIC ALGORITHM
1. Initialize 𝐾 cluster centers 𝑪 𝒌 = 𝒍 𝒌, 𝒂 𝒌, 𝒃 𝒌, 𝒙 𝒌, 𝒚 𝒌
𝑻
on a regular grid spaced 𝑆
=
𝑁
𝐾
pixels apart.
31
• each superpixel has approximately
𝑁
𝐾
pixels
33. THE MAIN STEPS OF THE SLIC ALGORITHM
2. move these cluster centers to the positions with the lowest gradients in a 3 × 3
neighborhood;
This is done to avoid centering a superpixel on an edge, and to reduce to chance
of seeding superpixel with a noisy pixel.
34
𝐺 𝑥, 𝑦 = 𝐼 𝑥, 𝑦 − 1 − 𝐼(𝑥, 𝑦 + 1) 2 + 𝐼 𝑥 − 1, 𝑦 − 𝐼(𝑥 + 1, 𝑦) 2
. . . .
.
.
.
.
.
.
.
.
.
.
.
.
𝑪1
𝑪5
𝑪9
𝑪13
𝑪2
𝑪6
𝑪10
𝑪14
𝑪3
𝑪7
𝑪11
𝑪15
𝑪4
𝑪8
𝑪12
𝑪16
34. THE MAIN STEPS OF THE SLIC ALGORITHM
2. move these cluster centers to the positions with the lowest gradients in a 3 × 3
neighborhood;
This is done to avoid centering a superpixel on an edge, and to reduce to chance
of seeding superpixel with a noisy pixel.
35
𝐺 𝑥, 𝑦 = 𝐼 𝑥, 𝑦 − 1 − 𝐼(𝑥, 𝑦 + 1) 2 + 𝐼 𝑥 − 1, 𝑦 − 𝐼(𝑥 + 1, 𝑦) 2
. . . .
.
.
.
.
.
.
.
.
.
.
.
.
𝑪1
𝑪5
𝑪9
𝑪13
𝑪2
𝑪6
𝑪10
𝑪14
𝑪3
𝑪7
𝑪11
𝑪15
𝑪4
𝑪8
𝑪12
𝑪16
.
35. THE MAIN STEPS OF THE SLIC ALGORITHM
3. Assign pixels. Designate each pixel to a closest cluster center in a local search
space;
36
K-means algorithm SLIC algorithm
36. THE MAIN STEPS OF THE SLIC ALGORITHM
3. Assign pixels. Designate each pixel to a closest cluster center in a local search
space;
37
for each cluster center 𝑪 𝒌
Assign the best matching pixels from a 𝟐𝑺 × 𝟐𝑺 around the cluster center according to the distance measure.
end for
. . . .
.
.
.
.
.
.
.
.
.
.
.
.
𝑪1
𝑪5
𝑪9
𝑪13
𝑪2
𝑪6
𝑪10
𝑪14
𝑪3
𝑪7
𝑪11
𝑪15
𝑪4
𝑪8
𝑪12
𝑪16
37. THE MAIN STEPS OF THE SLIC ALGORITHM
3. Assign pixels. Designate each pixel to a closest cluster center in a local search
space;
38
2 2 2
c j i j i j id l l a a b b
2 2
s j i j id x x y y
/S N K
2
2 2s
c
d
D d m
S
Distance measure
Color distance:
position distance:
𝐷′ =
𝑑 𝑐
𝑁𝑐
2
+
𝑑 𝑠
𝑁𝑠
2
𝐷′ =
𝑑 𝑐
𝑚
2
+
𝑑 𝑠
𝑆
2
m= Compactness of superpixel
39. THE MAIN STEPS OF THE SLIC ALGORITHM
3. Assign pixels. Designate each pixel to a closest cluster center in a local search
space by local KMC;
4. Update cluster centers. Set each cluster center as the mean of all pixels in the
corresponding cluster;
5. Repeat steps (3)–(4) until the clusters do not change or error (difference between
previous cluster and new cluster) is converge.
40
initialization iteration 1 iteration 2 iteration 3 iteration 4
40. THE MAIN STEPS OF THE SLIC ALGORITHM
6. Post-processing. The connected components algorithm is used to reassign
isolated regions to nearby superpixels if the size of the isolated regions is smaller
than a minimum size 𝑆 𝑚𝑖𝑛.
41
post-processing
42. SLICO
SLIC
SLICO
SLIC uses the same compactness parameter (chosen by user) for all superpixels in the image.
SLICO adaptively chooses the compactness parameter for each superpixel differently.
43
50. DIFFERENCE BETWEEN SLIC AND BSLIC
51
• initializing cluster centers in hexagon rather than square
distribution
• choosing some specific edge pixels as cluster centers
• incorporating boundary term into the distance measurement during
k-means clustering
53. INITIALIZATION OF EDGE CENTERS
54
Edge-across superpixels. (a) Original image with slender rod; (b) Edge image with canny filter operator; (c) Partial
enlarged superpixels with only plane centers initialized in hexagon distribution; (d) Partial enlarged superpixels
with only plane centers initialized in square distribution.
hexagon distribution square distribution
54. PLANE CENTER AND EDGE CENTER
55
Plane center and edge center. Dots in solid black Ci0, Ci1, Ci2, Ci3, Ci4, Ci5 and Ci6 are “plane center”;
Square in solid red Ei1 is “edge center”.
55. hexagon distribution square distribution
Segmentation without
edge cluster center
Segmentation with
edge cluster center
56
59. BSLIC ITERATING PROCESS
60
(a) Superpixels with only plane centers; (b) Superpixels with both plane and edge centers; (c)
First iterating result of BSLIC; (d) Final segmentation result of BSLIC.
61. PART OF BSLIC EXPERIMENTAL RESULTS
62TurbopixelsSLICSuperPBSEEDSBSLIC
62. REFERENCES
[1] Luc Vincent and Pierre Soille. Watersheds in digital spaces: An efficient algorithm based on immersion
simulations. IEEE Transactions on Pattern Analalysis and Machine Intelligence, 13(6):583–598, 1991.
[2] D. Comaniciu and P. Meer. Mean shift: a robust approach toward feature space analysis. IEEE
Transactions on Pattern Analysis and Machine Intelligence, 24(5):603–619, May 2002.
[3] Radhakrishna Achanta, Appu Shaji, Kevin Smith, Aurelien Lucchi, Pascal Fua, and Sabine
Süsstrunk, SLIC Superpixels Compared to State-of-the-art Superpixel Methods, IEEE Transactions on
Pattern Analysis and Machine Intelligence, vol. 34, num. 11, p. 2274 - 2282, May 2012.
[4] Radhakrishna Achanta, Appu Shaji, Kevin Smith, Aurelien Lucchi, Pascal Fua, and Sabine
Süsstrunk, SLIC Superpixels, EPFL Technical Report no. 149300, June 2010.
[5] Hai Wang, Xiongyou Peng, Xue Xiao, and Yan Liu, BSLIC: SLIC Superpixels Based on Boundary Term,
Symmetry 2017, 9(3), Feb 2017.
63