Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv_contrib
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv_contrib
Commits
ce2fd8e3
Commit
ce2fd8e3
authored
Jan 11, 2017
by
Balint Cristian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add MSLIC (Manifold SLIC).
parent
99294995
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
21 additions
and
10 deletions
+21
-10
superpixels_slic.png
modules/ximgproc/doc/pics/superpixels_slic.png
+0
-0
ximgproc.bib
modules/ximgproc/doc/ximgproc.bib
+8
-0
slic.hpp
modules/ximgproc/include/opencv2/ximgproc/slic.hpp
+11
-8
slic.cpp
modules/ximgproc/samples/slic.cpp
+2
-2
slic.cpp
modules/ximgproc/src/slic.cpp
+0
-0
No files found.
modules/ximgproc/doc/pics/superpixels_slic.png
View replaced file @
99294995
View file @
ce2fd8e3
This diff is collapsed.
Click to expand it.
modules/ximgproc/doc/ximgproc.bib
View file @
ce2fd8e3
...
...
@@ -160,6 +160,14 @@
keywords = {Superpixels, segmentation, clustering, k-means}
}
@InProceedings{Liu_2016_CVPR,
author = {Liu, Yong-Jin and Yu, Cheng-Chi and Yu, Min-Jing and He, Ying},
title = {Manifold SLIC: A Fast Method to Compute Content-Sensitive Superpixels},
booktitle = {The IEEE Conference on Computer Vision and Pattern Recognition (CVPR)},
month = {June},
year = {2016}
}
@InProceedings{LiCVPR2015LSC,
author = {Li, Zhengqin and Chen, Jiansheng},
title = {Superpixel Segmentation Using Linear Spectral Clustering},
...
...
modules/ximgproc/include/opencv2/ximgproc/slic.hpp
View file @
ce2fd8e3
...
...
@@ -61,6 +61,8 @@ namespace ximgproc
//! @addtogroup ximgproc_superpixel
//! @{
enum
SLIC
{
SLIC
=
100
,
SLICO
=
101
,
MSLIC
=
102
};
/** @brief Class implementing the SLIC (Simple Linear Iterative Clustering) superpixels
algorithm described in @cite Achanta2012.
...
...
@@ -68,7 +70,9 @@ SLIC (Simple Linear Iterative Clustering) clusters pixels using pixel channels a
to efficiently generate compact, nearly uniform superpixels. The simplicity of approach makes it
extremely easy to use a lone parameter specifies the number of superpixels and the efficiency of
the algorithm makes it very practical.
Several optimizations are available for SLIC class:
SLICO stands for "Zero parameter SLIC" and it is an optimization of baseline SLIC descibed in @cite Achanta2012.
MSLIC stands for "Manifold SLIC" and it is an optimization of baseline SLIC described in @cite Liu_2016_CVPR.
*/
class
CV_EXPORTS_W
SuperpixelSLIC
:
public
Algorithm
...
...
@@ -134,26 +138,25 @@ public:
};
/** @brief
Class implementing the SLIC (Simple Linear Iterative Clustering) superpixels
/** @brief
Initialize a SuperpixelSLIC object
@param image Image to segment
@param algorithm Chooses the algorithm variant to use:
SLIC segments image using a desired region_size, and in addition
SLICO will choose an adaptive compactness factor
.
SLIC segments image using a desired region_size, and in addition
SLICO will optimize using adaptive compactness factor,
while MSLIC will optimize using manifold methods resulting in more content-sensitive superpixels
.
@param region_size Chooses an average superpixel size measured in pixels
@param ruler Chooses the enforcement of superpixel smoothness factor of superpixel
The function initializes a SuperpixelSLIC object for the input image. It sets the parameters of choosed
superpixel algorithm, which are: region_size and ruler. It preallocate some buffers for future
computing iterations over the given image. An example of SLIC versus SLICO is ilustrated in the
following picture.
computing iterations over the given image. For enanched results it is recommended for color images to
preprocess image with little gaussian blur using a small 3 x 3 kernel and additional conversion into
CieLAB color space. An example of SLIC versus SLICO and MSLIC is ilustrated in the following picture.
![image](pics/superpixels_slic.png)
*/
enum
SLIC
{
SLIC
=
100
,
SLICO
=
101
};
CV_EXPORTS_W
Ptr
<
SuperpixelSLIC
>
createSuperpixelSLIC
(
InputArray
image
,
int
algorithm
=
SLICO
,
int
region_size
=
10
,
float
ruler
=
10.0
f
);
...
...
modules/ximgproc/samples/slic.cpp
View file @
ce2fd8e3
...
...
@@ -19,7 +19,7 @@ static const char* keys =
"{h help | | help menu}"
"{c camera |0| camera id}"
"{i image | | image file}"
"{a algorithm |1| SLIC(0),SLICO(1)}"
"{a algorithm |1| SLIC(0),SLICO(1)
,MSLIC(2)
}"
;
int
main
(
int
argc
,
char
**
argv
)
...
...
@@ -63,7 +63,7 @@ int main(int argc, char** argv)
}
namedWindow
(
window_name
,
0
);
createTrackbar
(
"Algorithm"
,
window_name
,
&
algorithm
,
1
,
0
);
createTrackbar
(
"Algorithm"
,
window_name
,
&
algorithm
,
2
,
0
);
createTrackbar
(
"Region size"
,
window_name
,
&
region_size
,
200
,
0
);
createTrackbar
(
"Ruler"
,
window_name
,
&
ruler
,
100
,
0
);
createTrackbar
(
"Connectivity"
,
window_name
,
&
min_element_size
,
100
,
0
);
...
...
modules/ximgproc/src/slic.cpp
View file @
ce2fd8e3
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment