Coder Social home page Coder Social logo

slic-python-implementation's Introduction

slic-python-implementation

The python implementation to make superpixels by slic.

The code is pretty old, and support python27 only.

RUN

pip install -r requirements.txt
python slic.py

see:

  1. SLIC Superpixels Compared to State-of-the-art Superpixel Methods by Radhakrishna Achanta, Appu Shaji, Kevin Smith, Aurelien Lucchi, Pascal Fua, and Sabine Su ̈sstrunk

  2. My post: SLIC算法分割超像素原理及Python实现

slic-python-implementation's People

Contributors

dependabot[bot] avatar laixintao avatar wchstrife avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

slic-python-implementation's Issues

mistake in slic code

hi, I have read your SLIC code and blog, I find a mistake in slic.py Line 88, I think you should exchange h and w in that line to compute the gradient correctly?

I cant install it

Hello
when I try to install requirement.txt I sow this message

pip install -r requirements.txt
Requirement already satisfied: cycler==0.10.0 in /home/abdel/anaconda3/lib/python3.7/site-packages (from -r requirements.txt (line 1)) (0.10.0)
Collecting decorator==4.1.2 (from -r requirements.txt (line 2))
  Using cached https://files.pythonhosted.org/packages/a1/4e/c42167ba5c3192bed633726d39d7896cc55d4fa3ec4a1fb60cd3a53fc4c7/decorator-4.1.2-py2.py3-none-any.whl
Collecting functools32==3.2.3.post2 (from -r requirements.txt (line 3))
  Using cached https://files.pythonhosted.org/packages/c5/60/6ac26ad05857c601308d8fb9e87fa36d0ebf889423f47c3502ef034365db/functools32-3.2.3-2.tar.gz
    Complete output from command python setup.py egg_info:
    This backport is for Python 2.7 only.
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-ibungk0n/functools32/

Thanks
Abdel

代码报错了。请问是什么原因呢?

gradient = self.data[w + 1][h + 1][0] - self.data[w][h][0] + self.data[w + 1][h + 1][1] - self.data[w][h][1] + self.data[w + 1][h + 1][2] - self.data[w][h][2]

IndexError: index 600 is out of bounds for axis 0 with size 600

search window 2s

The search window is 2S in paper, but in your code, it seems that you use a window with size 4S. Why is that?

def assignment(self):
for cluster in self.clusters:
for h in range(cluster.h - 2 * self.S, cluster.h + 2 * self.S):
if h < 0 or h >= self.image_height: continue
for w in range(cluster.w - 2 * self.S, cluster.w + 2 * self.S):
if w < 0 or w >= self.image_width: continue
L, A, B = self.data[h][w]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.