Skip to content
/ SLIC Public

Simple Linear Iterative Clustering for Segmentation and Tracking

Notifications You must be signed in to change notification settings

Debjoy10/SLIC

Repository files navigation

SLIC

Simple Linear Iterative Clustering (Paper)

Install Dependencies
pip install -r requirements.txt
Pixel-SLIC
usage: python slic.py [-h] [-p PATH] [-s S [S ...]] [-r] [-n NUM] [-t THRESHOLD] [-o OUTPUT] [-dp]

optional arguments:                                                                                                   
    -h, --help                                            show this help message and exit
    -p PATH, --path PATH                                  Image to run SLIC on
    -s S [S ...], --S S [S ...]                           Superpixel Size (s or (sx sy))
    -r, --rect                                            Allow/use rectangular superpixel
    -n NUM, --num NUM                                     Number of Superpixel (Used to compute S, if S is not provided)
    -t THRESHOLD, --threshold THRESHOLD                   Residual error threshold (Breaking condition)
    -o OUTPUT, --output OUTPUT                            Path to write outputs
    -dp, --disable_postprocessing                         Disable Postprocessing of the output clusters
Voxel-SLIC
usage: python slic_voxels.py [-h] [-p PATH] [-s S [S ...]] [-r] [-n NUM] [-t THRESHOLD] [-o OUTPUT] [-c] [-dp]

optional arguments:
  -h, --help                                              show this help message and exit
  -p PATH, --path PATH                                    Video to run SLIC on
  -s S [S ...], --S S [S ...]                             Superpixel Size (s or (sx sy))
  -r, --rect                                              Allow/use rectangular superpixel
  -n NUM, --num NUM                                       Number of Superpixel
  -t THRESHOLD, --threshold THRESHOLD                     Residual error threshold
  -o OUTPUT, --output OUTPUT                              Path to write outputs
  -c, --plt_surface                                       If true plot the surface plot of the output
  -dp, --disable_postprocessing                           Disable Postprocessing of the output clusters
Stereo-Voxel-SLIC
usage: python slic_stereo_voxels.py [-h] [-p PATH] [-s S [S ...]] [-r] [-n NUM] [-t THRESHOLD] [-o OUTPUT]

optional arguments:
  -h, --help                                              show this help message and exit
  -p PATH, --path PATH                                    Video to run SLIC on
  -s S [S ...], --S S [S ...]                             Superpixel Size (s or (sx sy))
  -r, --rect                                              Allow/use rectangular superpixel
  -n NUM, --num NUM                                       Number of Superpixel
  -t THRESHOLD, --threshold THRESHOLD                     Residual error threshold
  -o OUTPUT, --output OUTPUT                              Path to write outputs

Output from running python slic.py -p images/lena_color_512.jpg -s 15

Original Segmented
lena_color_512 out

Output from running python slic.py -p images/hdimg.jpg -r

Original Segmented
hdimg out

Output from running python slic_voxels.py -p images/flag_low_res.mp4 (Link)

Output from running python slic_stereo_voxels.py -p ../sintelLF/ambushfight_1/ (Link)

TODOs

  • SLIC on pixels SLIC.py
  • SLIC on voxels (video) (New code file video_SLIC.py using voxel class from feature.py)
  • Add visualisation function for video SLIC (in visualisation.py - check paper for an example)
  • Code to move pixel to lowest gradient position in 3x3 neighbourhood
  • Connectivity enforcing postprocessing step (For all SLICs)
  • Add Stereo-video-SLIC code
  • Add support for allowing rectangular superpixels
  • Add inter-cluster tracking for video/stereo
  • Trackbar based display
  • Check code for errors

Part of Term Project for EC69502: Image Processing Lab, IIT Kharagpur

About

Simple Linear Iterative Clustering for Segmentation and Tracking

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages