GithubHelp home page GithubHelp logo

micklexqg / sdrs_cimg Goto Github PK

View Code? Open in Web Editor NEW

This project forked from assamite/sdrs_cimg

0.0 2.0 0.0 1 MB

Salient Region Detection for Python using CImg

License: GNU General Public License v3.0

C++ 99.08% Makefile 0.34% C 0.37% Python 0.20%

sdrs_cimg's Introduction

Salient Region Detection and Segmentation for Python Using CImg

This is an UNIX platform oriented version of Salient Region Detection and Segmentation technique represented in:

R. Achanta, S. Hemami, F. Estrada and S. Süsstrunk, Frequency-tuned Salient Region Detection, IEEE International Conference on Computer Vision and Pattern Recognition (CVPR 2009), pp. 1597 - 1604, 2009.

Check also the webpage for the paper. Most of the code is unaltered from the C++ sources given on the webpage.

The differences are:

  • Use of CImg to handle picture loading and saving for platform independence
  • Changed the code to work as a command line tool
  • Added Python wrapper (with ctypes) for main functionality

Dependencies

  • CImg: For loading and saving pictures.
  • boost: Used for filepath manipulation. In case you don't want to use boost, you can alter the source of CImgHandler::SavePictures
  • Image libraries: Defaults are libpng and libjpeg. Check CImg documentation for full list of supported formats.

The conversion has been done with minimum amount of work so any input and/or change suggestions are welcome.

Usage

  1. As Command line tool:

    1.1 Compile program with make

    1.2 Call the program created:

    $>./saliency [-s] [-o=path/to/outfolder/] path/to/pic1 path/to/pic2 path/to/pic3 ...

    where optional '-s' argument tells the program to not only do saliency mapping, but also mean shift based processing and extracting the most salient objects from the pictures.

  2. From Python:

    2.1 Compile program as shared library with make shared_osx or make shared_linux

    2.2 Instantiate SDRWrapper object in Python and call it:

    from sdrWrapper import SDRWrapper
    sdrw = SDRWrapper()
    doSegmentation = True # Extract most salient objects
    sdrw.saliency("path/to/outfolder", "path/to/my/pic", doSegmentation)

Created pictures are saved with different suffixes. For example, running code for bird.jpg will create three different files to the output folder when most salient objects are extracted:

  • bird_sm.jpg - saliency map
  • bird_ms.jpg - mean shift based segmentation
  • bird_so.jpg - most salient object

sdrs_cimg's People

Contributors

assamite avatar

Watchers

James Cloos avatar  avatar

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.