Skip to content
/ slic Public

Implementation of the SLIC algorithm for Image Segmentation using Superpixels.

License

Notifications You must be signed in to change notification settings

tomsarry/slic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SLIC

Introduction

The SLIC algorithm was developped by researchers at EPFL in 2010. It constrasted with the other competing State-of-the-Art superpixels segmentation algorithms because it was the fastest at the time and was easy to use, ie. it did not require many parameters to obtain a good segmentation. In fact, the Simple Linear Iterative Clustering algorithm runs in O(N) time, compared to O(NlogN) or even O(N^2) for other methods.

Report

A report (written in French) that gives more precise information about the algorithm is also available here.

Guide

Requirements

  • make
  • gcc
  • The mogrify CLI util is not required but it is highly encouraged to have it for easy image format conversion.

How to use

  1. Clone the repository
  2. Place desired .ppm image in the src directory and modify NAME_IMG_IN in main.c.
  3. Build using make
$ cd slic/src && make
  1. Run the executable
$ ./main

Results

Below are some of the results obtained after running the SLIC aglorithm, based on n, the number of superpixels.

Initial Image n=256 n=512 n=1024
Initial Image Segmented Image Segmented Image Segmented Image
Initial Image Segmented Image Segmented Image Segmented Image
Initial Image Segmented Image Segmented Image Segmented Image

Contribution

Contributions are more than welcome, simply clone the repository and open a PR.

Disclaimer

This code is provided as is and may contain bugs, or not accurately transcribe the algorithm given in the original paper it is based on.

About

Implementation of the SLIC algorithm for Image Segmentation using Superpixels.

Topics

Resources

License

Stars

Watchers

Forks