Code Monkey home page Code Monkey logo

selectivesearch's Introduction

Selective Search Implementation for Python

This is a simple Selective Search Implementation for Python

Install

$ pip install selectivesearch

Usage

It is super-simple.

import skimage.data
import selectivesearch

img = skimage.data.astronaut()
img_lbl, regions = selectivesearch.selective_search(img, scale=500, sigma=0.9, min_size=10)
regions[:10]
=>
[{'labels': [0.0], 'rect': (0, 0, 15, 24), 'size': 260},
 {'labels': [1.0], 'rect': (13, 0, 1, 12), 'size': 23},
 {'labels': [2.0], 'rect': (0, 15, 15, 11), 'size': 30},
 {'labels': [3.0], 'rect': (15, 14, 0, 0), 'size': 1},
 {'labels': [4.0], 'rect': (0, 0, 61, 153), 'size': 4927},
 {'labels': [5.0], 'rect': (0, 12, 61, 142), 'size': 177},
 {'labels': [6.0], 'rect': (7, 54, 6, 17), 'size': 8},
 {'labels': [7.0], 'rect': (28, 50, 18, 32), 'size': 22},
 {'labels': [8.0], 'rect': (2, 99, 7, 24), 'size': 24},
 {'labels': [9.0], 'rect': (14, 118, 79, 117), 'size': 4008}]

See also an example/example.py which generates : alt tag

Parameters of selective search

Let's see this paper: http://cs.brown.edu/~pff/papers/seg-ijcv.pdf

sigma

In general we use a Gaussian filter to
smooth the image slightly before computing the edge weights, in order to compensate
for digitization artifacts. We always use a Gaussian with σ = 0.8, which does not
produce any visible change to the image but helps remove artifacts.

min_size

If the rect size is reached on min_size, the calculation is stopped.

scale

There is one runtime parameter for the algorithm, which is the value of k that
is used to compute the threshold function τ . Recall we use the function τ (C) =
14
k/|C| where |C| is the number of elements in C. Thus k effectively sets a scale of
observation, in that a larger k causes a preference for larger components. We use
two different parameter settings for the examples in this section (and throughout the
paper), depending on the resolution of the image and the degree to which fine detail
is important in the scene.

Blog

selectivesearch's People

Contributors

exilis avatar danoneata avatar ethiy avatar gamella avatar csaftoiu avatar takahira avatar willkuhn avatar

Watchers

James Cloos avatar Artur Barseghyan 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.