Giter VIP home page Giter VIP logo

idisf's Introduction

Interactive Dynamic and Iterative Spanning Forest (iDISF)

This repository contains a tool for interactive image segmentation and an iDISF implementation.

Interactive DISF (iDISF)

From an image labeled with scribbles, it performs an oversampling of background seeds and, through the iterations, generates superpixels and removes those considered as irrelevant. In this work, removal strategies by class and relevance are used. In removing by class the algorithm performs a desired number of iterations, and in removing by relevance the algorithm stops when reaching the desired amount of superpixels.

Languages supported

C/C++ (Implementation) and Python3 (Wrapper)

Requirements

The following tools are required in order to start the installation.

  • OpenMP
  • Python 3

Compiling and cleaning

  • To compile all files: make
  • For removing all generated files from source: make clean

Installing the python interface

  1. Install Tkinter library for python3 to run the interface: sudo apt-get install python3-tk

  2. To use the graphical user interface tool, we recommend to install the required python packages using pipenv:

    • Install pipenv: pip3 install pipenv

    • Create a virtual environment and install the required packages from PipFile: pipenv install

    • Install iDISF package (make sure you successfully run make before it): cd python3/; pipenv run python3 -m pip install . ; cd ..

The following python libraries are required to run the graphical user interface.

  • Pillow
  • Numpy
  • Scipy
  • opencv-python
  • opencv-contrib-python
  • Higra
  • Matplotlib
  • Pydicom
  • ttkthemes

For those not using any virtual environment, the iDISF package must be installed with: cd python3/; python3 -m pip install . ; cd ..

If an error occurs due to a file not found when installing the iDISF package, consider changing directories in python3/setup.py.

Running

In this project, there are two demo files, one for each language supported (i.e., C and Python3). After compiling and assuring the generation of the necessary files, one can execute each demo within its own environment.

iDISF only

  • The complete iDISF project can be executed by ./bin/DISF_demo
  • For the command options, run ./bin/DISF_demo --help
  • A demo example from iDISF in python3: python3 DISF_demo.py

Interface

  • For those using pipenv, run the user interface with the follow command: pipenv run python3 iDISF.py
  • For those not using any virtual environment, run the user interface with the follow command: python3 iDISF.py
  • Our interface includes iDISF and Watershed segmentation. For Watershed, we use higra package.

Cite

If this work was useful for your research, please cite our paper:

@InProceedings{barcelos2021towards,
  title={Towards Interactive Image Segmentation by Dynamic and Iterative Spanning Forest},
  author={Barcelos, Isabela Borlido and Bel{\'e}m, Felipe and Miranda, Paulo and Falc{\~a}o, Alexandre Xavier and do Patroc{\'\i}nio, Zenilton KG and Guimar{\~a}es, Silvio Jamil F},
  booktitle={International Conference on Discrete Geometry and Mathematical Morphology},
  publisher={Springer International Publishing},
  pages={351--364},
  year={2021},
  organization={Springer}
}

Contact

Please, feel free to contact the authors for any unexpected behavior you might face (e.g., bugs). Moreover, if you’re interested in using our code, we appreciate if you cite this work in your project.

idisf's People

Contributors

isabelabb avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

lvcardoso

idisf's Issues

Bug: Compilation error

If it is possible, please add an Dockerfile to this project.

Code does not compile in Arch Linux: 6.6.3-arch1-1 #1 SMP PREEMPT_DYNAMIC Wed, 29 Nov 2023 00:37:40 +0000 x86_64 GNU/Linux

(iDISF) [lucas@Lucas-PC iDISF]$ python3.10 -m pip install python3/.
Processing ./python3
  Preparing metadata (setup.py) ... done
Building wheels for collected packages: iDISF
  Building wheel for iDISF (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [12 lines of output]
      In file included from /home/lucas/.local/share/virtualenvs/iDISF-3hYUVbwY/lib/python3.10/site-packages/numpy/core/include/numpy/ndarraytypes.h:1929,
                       from /home/lucas/.local/share/virtualenvs/iDISF-3hYUVbwY/lib/python3.10/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,
                       from /home/lucas/.local/share/virtualenvs/iDISF-3hYUVbwY/lib/python3.10/site-packages/numpy/core/include/numpy/arrayobject.h:5,
                       from iDISF_py3.c:15:
      /home/lucas/.local/share/virtualenvs/iDISF-3hYUVbwY/lib/python3.10/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
         17 | #warning "Using deprecated NumPy API, disable it with " \
            |  ^~~~~~~
      iDISF_py3.c:17:10: fatal error: Image.h: No such file or directory
         17 | #include "Image.h"
            |          ^~~~~~~~~
      compilation terminated.
      error: command '/usr/bin/gcc' failed with exit code 1
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for iDISF
  Running setup.py clean for iDISF
Failed to build iDISF
ERROR: Could not build wheels for iDISF, which is required to install pyproject.toml-based projects

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.