SIFT
Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | List of all members
sift::Sift Class Reference

#include <sift.hpp>

Public Member Functions

 Sift (u16_t dogsPerEpoch=3, u16_t octaves=3, f32_t sigma=1.6, f32_t k=std::sqrt(2), bool subpixel=false)
 
std::vector< InterestPointcalculate (vigra::MultiArray< 2, f32_t > &)
 

Public Attributes

const bool subpixel
 

Private Member Functions

void _createDecriptors (std::vector< InterestPoint > &)
 
std::vector< f32_t_eliminateVectorThreshold (std::vector< f32_t > &) const
 
void _createMagnitudePyramid ()
 
void _createOrientationPyramid ()
 
void _eliminateEdgeResponses (std::vector< InterestPoint > &, const Matrix< OctaveElem > &) const
 
const std::set< f32_t_findPeaks (const std::array< f32_t, 36 > &) const
 
void _orientationAssignment (std::vector< InterestPoint > &)
 
const Point< u16_t, u16_t_findNearestGaussian (f32_t)
 
void _findScaleSpaceExtrema (const Matrix< OctaveElem > &, std::vector< InterestPoint > &) const
 
const Matrix< OctaveElem_createDOGs (vigra::MultiArray< 2, f32_t > &)
 

Private Attributes

const f32_t _sigma
 
const f32_t _k
 
const u16_t _dogsPerEpoch
 
const u16_t _octaves
 
Matrix< OctaveElem_gaussians
 
Matrix< vigra::MultiArray< 2, f32_t > > _magnitudes
 
Matrix< vigra::MultiArray< 2, f32_t > > _orientations
 

Constructor & Destructor Documentation

sift::Sift::Sift ( u16_t  dogsPerEpoch = 3,
u16_t  octaves = 3,
f32_t  sigma = 1.6,
f32_t  k = std::sqrt(2),
bool  subpixel = false 
)
inlineexplicit
Parameters
sigmastandard value 1.6
kstandard value square root of 2
dogsPerEpochHow many DOGs should be created per octave
octaveshow many octaves should be calculated
subpixelwether the calculation is based on subpixel basis or not

Member Function Documentation

void sift::Sift::_createDecriptors ( std::vector< InterestPoint > &  interestPoints)
private

Creates the local image desciptors.

Parameters
interestpointsthe vector with interestpoints
const Matrix< OctaveElem > sift::Sift::_createDOGs ( vigra::MultiArray< 2, f32_t > &  img)
private

Creates the Difference of Gaussians for the count of octaves.

Parameters
imgthe given img
Returns
a matrix with the octaves as width and octave elements as height, which contain the DoGs
void sift::Sift::_createMagnitudePyramid ( )
private

Creates magnitude versions of all the gaussian images.

void sift::Sift::_createOrientationPyramid ( )
private

Create orientation versions of all the gaussian images.

void sift::Sift::_eliminateEdgeResponses ( std::vector< InterestPoint > &  interestPoints,
const Matrix< OctaveElem > &  dogs 
) const
private

Keypoint Location using Taylor expansion to filter the weak interest points. Those interest points, which get filtered get their filtered flag set to true

Parameters
interestpointsthe vector with interestpoints
dogsthe dogs which were calculated in an earlier step
std::vector< f32_t > sift::Sift::_eliminateVectorThreshold ( std::vector< f32_t > &  vec) const
private

Eliminates all values above the threshold of 0.2 and performs a new vector normalization as long as there are no more values above 0.2

Parameters
vecThe given vector
const Point< u16_t, u16_t > sift::Sift::_findNearestGaussian ( f32_t  scale)
private

Finds the nearest gaussian, based on the scale given

Parameters
scalethe scale
Returns
the point where the Gaussian is lying in the pyramid
const std::set< f32_t > sift::Sift::_findPeaks ( const std::array< f32_t, 36 > &  histo) const
private

Searches for the highest Element in the orientation histogram and searches for other orientations within a 80% range. Everything outside the range will be set to -1.

Parameters
histoThe given histogram on which the peak calculation finds place
Returns
an array with 36 elements, standing for the 36 bins of orientation possibilities
void sift::Sift::_findScaleSpaceExtrema ( const Matrix< OctaveElem > &  dogs,
std::vector< InterestPoint > &  interestPoints 
) const
private

Finds the Scale space extrema aka InterestPoints

Parameters
dogsa matrix of DOGs
interestPointsa vector which holds interestPoints. Will be filled with the found interest points
void sift::Sift::_orientationAssignment ( std::vector< InterestPoint > &  interestPoints)
private

Calculates the orientation assignments for the interestPoints

Parameters
interestPointsthe found interestPoints for whom the orientation should be calulated
std::vector< InterestPoint > sift::Sift::calculate ( vigra::MultiArray< 2, f32_t > &  img)

Processes the whole Sift calculation

Parameters
imgthe given image
Returns
a vector containing the filtered sift features

Member Data Documentation

const u16_t sift::Sift::_dogsPerEpoch
private

How many DoGs will be calculated per epoch. Minimum is 3.

Matrix<OctaveElem> sift::Sift::_gaussians
private

The Gaussians calculated during the algorithm.

const f32_t sift::Sift::_k
private

The constant which is multiplied with sigma to get the Gaussians and DoGs.

Matrix<vigra::MultiArray<2, f32_t> > sift::Sift::_magnitudes
private

The magnitudes of the gaussians

const u16_t sift::Sift::_octaves
private

How many octaves of DoGs will be calculated.

Matrix<vigra::MultiArray<2, f32_t> > sift::Sift::_orientations
private

The orientations of the gaussians

const f32_t sift::Sift::_sigma
private

The sigma value is used for the standard derivation of the Gaussian calculations.

const bool sift::Sift::subpixel

Wether to process the algorithm based on subpixel basis or not


The documentation for this class was generated from the following files: