Giter Club home page Giter Club logo

foveatedfeatures's Introduction

foveatedFeatures

This is the source code of the Foveated Features Extraction, as a result of research done by Rafael Beserra. It uses Opencv2.4.8 for implementation and no more others dependencies. Consider citing the related paper to this project: Rafael Beserra Gomes, Bruno Motta de Carvalho, Luiz Marcos Garcia Gonçalves, Visual attention guided features selection with foveated images, Neurocomputing, Volume 120, 23 November 2013, Pages 34-44, ISSN 0925-2312, http://dx.doi.org/10.1016/j.neucom.2012.10.033.

This software is under GNU GPL (read LICENSE file for more informations).

Foveation variable summary

The feature extraction process is done by a sequence of n steps. This differs slight from the original paper. If you want a easy configuration, use one of these values:

  • numberOfLevels = 4, etavector = [4, 3, 2, 1], levels = [0, 1, 2, 3], b = [1, 1, 1, 1]
  • numberOfLevels = 5, etavector = [5, 4, 3, 2, 1], levels = [0, 1, 2, 3, 4], b = [1, 1, 1, 1, 1]

In the original paper, there are a B vector and a eta vector, each one with numberOfLevels elements. For example, 4 levels, B = {1, 1, 0, 1} and eta = {4, 3, 2, 1}, this set means that there are 4 steps for feature extraction:

  • first level (largest one) computes features in the fourth octave
  • second level computes features in the third octave
  • third level would compute features in the second octave, but is does not because B[3] = 0
  • fourth level computes features in the first octave

See section 3.2 from neurocomputing paper for examples.

In this implementation, bvector (B), etavector (eta) and levelvector have n elements, the set {bvector[i], etavector[i], levelvector[i]} represents a feature extraction step.

  • bvector: [b1, b2, ..., bn]: a vector where bi is 0 if the feature extraction step number i should be discarded or 1, otherwise
  • etavector: [e1, e2, ..., en]: a vector where ei is the octave (> 0) for which the feature extraction step number i should be performed
  • levelvector: [l1, l2, ..., ln]: a vector where li is the foveated model level (>= 0 and < numberOfLevels) for which the feature extraction step number i should be performed

For example: 4 levels, B = {1, 0, 1, 1, 1}, eta = {3, 4, 2, 3, 1} and levels = {0, 0, 1, 1, 3}, this set means that there are 5 steps for feature extraction:

  • first step (B[1] = 1, eta[1] = 3 and levels[1] = 0): a feature extraction in the third octave is performed in the first level (largest one)
  • second step (B[2] = 0, eta[2] = 4 and levels[2] = 0): a feature extraction in the fourth octave would be performed in the first level (largest one), but it does not because B[2] = 0
  • third step (B[3] = 1, eta[3] = 2 and levels[3] = 1): a feature extraction in the second octave is performed in the second level
  • fourth step (B[4] = 1, eta[4] = 3 and levels[4] = 1): a feature extraction in the third octave is performed in the second level
  • fifth step (B[5] = 1, eta[5] = 1 and levels[5] = 3): a feature extraction in the first octave is performed in the fourth level

This also means that:

  • first level (largest one) computes features in the third octave (levels[1] = 0, levels[2] = 0, eta[1] = 3, eta[2] = 4, but B[2] = 0)
  • second level computes features in the second and third octave (levels[3] = 1, levels[4] = 1, eta[3] = 2, eta[4] = 3)
  • third level has no feature extraction (since no level = 2)
  • fourth level computes features in the first octave (levels[5] = 3, eta[5] = 1)

Usage

First, you must create a yml file that contains initial values of the foveated model. You MUST specify the following parameters:

  • smallestLevelWidth: 0 < value < imageWidth
  • smallestLevelHeight: 0 < value < imageHeight
  • numberOfLevels: value > 1
  • bvector: [b1, b2, ..., bn], where each value is 0 or 1
  • etavector: [e1, e2, ..., en], where each value > 0
  • levelvector: [l1, l2, ..., ln], where value >= 0 and value < numberOfLevels Note that these last 3 sequence must have the same number of elements

Second, use the struct FoveatedHessianDetectorParams to specify:

  • the image size (no default value)
  • the YML file path containing the foveated model parameters (no default file)
  • hessian threshold (default value: 100);
  • the number of layers in each octave (it is preferable to use default value: 3).

Use FoveatedHessianDetectorParams(int imageWidth, int imageHeight, String ymlFile) construtor to specify the original image size and the yml file file path.

After that, use foveatedHessianDetector function: static void foveatedHessianDetector(InputArray _img, InputArray _mask, vector& keypoints, FoveatedHessianDetectorParams params);

foveatedfeatures's People

Contributors

rafaelbes avatar petrucior avatar

Stargazers

Bruno Silva avatar

Watchers

James Cloos avatar  avatar Bruno Silva avatar  avatar  avatar

Forkers

petrucior ldepn

foveatedfeatures's Issues

YML reading testing

(1) Make tests with values outside these intervals in order to reproduce erros:

0 < smallestLevelWidth < imageWidth
0 < smallestLevelHeight < imageHeight
numberOfLevels > 1
bvector: sequência de n numéricos in {0, 1}
etavector: sequência de n numéricos in {1, 2, ... }
levelvector: sequência de n numéricos in {0, 1, ..., numberOfLevels - 1}
foveax: [(smallestLevelWidth - imageWidth)/2, (imageWidth - smallestLevelWidth)/2]
foveay: [(smallestLevelHeight - imageHeight)/2, (imageHeight - smallestLevelHeight)/2]
hessianThreshold > 0
growthfactor > 0

(2) Test by not providing some of these values

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.