Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Friends
DVision::SurfSet Class Reference

#include <SurfSet.h>

List of all members.

Public Member Functions

void CalculateCorrespondences (const SurfSet &B, std::vector< int > &A_corr, std::vector< int > &B_corr, std::vector< double > *distances=NULL, bool remove_duplicates=true, double max_ratio=0.6) const
void CalculateFastCorrespondences (const SurfSet &B, std::vector< int > &A_corr, std::vector< int > &B_corr, std::vector< double > *distances=NULL, bool remove_duplicates=true, double max_ratio=0.6)
void Compute (const cv::Mat &image, const std::vector< cv::KeyPoint > &keypoints, bool extended=false)
void Extract (const cv::Mat &image, double hessianTh=400.0, bool extended=false)
int GetDescriptorLength () const
int getPointOctave (const CvSURFPoint &kpt, const CvSURFParams &params)
void Load (const std::string &filename)
void LoadCustom (const std::string &filename)
void RecalculateApproximationTree ()
void Save (const std::string &filename) const
void SaveCustom (const std::string &filename) const
unsigned int size () const
 SurfSet ()
virtual ~SurfSet ()

Public Attributes

std::vector< float > descriptors
std::vector< cv::KeyPoint > keys
std::vector< int > laplacians

Protected Member Functions

void calculateCorrespondencesApproximate (const SurfSet &B, std::vector< int > &A_corr, std::vector< int > &B_corr, std::vector< double > *distances, bool remove_duplicates, double max_ratio)
void calculateCorrespondencesNaive (const SurfSet &B, std::vector< int > &A_corr, std::vector< int > &B_corr, std::vector< double > *distances, bool remove_duplicates, double max_ratio) const
double calculateSqDistance (std::vector< float >::const_iterator ita, std::vector< float >::const_iterator itb, const int L) const
int getPointOctave (const CvSURFPoint &kpt, const CvSURFParams &params) const
void load (cv::FileStorage &fs, int idx)
void save (cv::FileStorage &fs, int idx) const

Protected Attributes

cv::flann::Indexm_index

Friends

class Matches

Detailed Description

Definition at line 40 of file SurfSet.h.


Constructor & Destructor Documentation

Definition at line 49 of file SurfSet.h.

virtual DVision::SurfSet::~SurfSet ( ) [inline, virtual]

Definition at line 50 of file SurfSet.h.


Member Function Documentation

void SurfSet::CalculateCorrespondences ( const SurfSet B,
std::vector< int > &  A_corr,
std::vector< int > &  B_corr,
std::vector< double > *  distances = NULL,
bool  remove_duplicates = true,
double  max_ratio = 0.6 
) const

Calculates correspondences between this set and the set B

Parameters:
Bother set
A_corrindices of matched points from this set
B_corrindices of matched points from the set B
distancesif given, the distance between the correspondences is stored here
remove_duplicatesif true, ambiguous matches are discarded
max_ratiomax ratio between the two nearest neighbours

Definition at line 283 of file SurfSet.cpp.

void SurfSet::calculateCorrespondencesApproximate ( const SurfSet B,
std::vector< int > &  A_corr,
std::vector< int > &  B_corr,
std::vector< double > *  distances,
bool  remove_duplicates,
double  max_ratio 
) [protected]

Calculates correspondences between this set and the set B by flann

Parameters:
Bother set
A_corrindices of matched points from this set
B_corrindices of matched points from the set B
distancesthe distance between the correspondences is stored here
remove_duplicatesif true, ambiguous matches are discarded
max_ratiomax ratio between the two nearest neighbours

Definition at line 305 of file SurfSet.cpp.

void SurfSet::calculateCorrespondencesNaive ( const SurfSet B,
std::vector< int > &  A_corr,
std::vector< int > &  B_corr,
std::vector< double > *  distances,
bool  remove_duplicates,
double  max_ratio 
) const [protected]

Calculates correspondences between this set and the set B by brute force

Parameters:
Bother set
A_corrindices of matched points from this set
B_corrindices of matched points from the set B
distancesthe distance between the correspondences is stored here
remove_duplicatesif true, ambiguous matches are discarded
max_ratiomax ratio between the two nearest neighbours

Definition at line 446 of file SurfSet.cpp.

void SurfSet::CalculateFastCorrespondences ( const SurfSet B,
std::vector< int > &  A_corr,
std::vector< int > &  B_corr,
std::vector< double > *  distances = NULL,
bool  remove_duplicates = true,
double  max_ratio = 0.6 
)

Calculates correspondences between this set and the set B by using flann

Parameters:
Bother set
A_corrindices of matched points from this set
B_corrindices of matched points from the set B
distancesif given, the distance between the correspondences is stored here
remove_duplicatesif true, ambiguous matches are discarded
max_ratiomax ratio between the two nearest neighbours

Definition at line 294 of file SurfSet.cpp.

double SurfSet::calculateSqDistance ( std::vector< float >::const_iterator  ita,
std::vector< float >::const_iterator  itb,
const int  L 
) const [protected]

Calculates the square distance between two descriptors

Parameters:
itabeginning of one descriptor
itbbeginning of the other descriptor
Llength of descriptor vectors

Definition at line 549 of file SurfSet.cpp.

void SurfSet::Compute ( const cv::Mat &  image,
const std::vector< cv::KeyPoint > &  keypoints,
bool  extended = false 
)

Copies the given keypoints and computes their SURF descriptors

Parameters:
image
keypoints
extendedif true, 128-dimensional surf are used instead of 64-d
Note:
the laplacian vector cannot be computed, so it is filled with ones

Definition at line 192 of file SurfSet.cpp.

void SurfSet::Extract ( const cv::Mat &  image,
double  hessianTh = 400.0,
bool  extended = false 
)

Extract surf points from an image

Parameters:
image
surfsurf data
hessianThhessian threshold
extendedif true, 128-dimensional surf are used instead of 64-d
Note:
the octave is not returned and it is always 1

Definition at line 112 of file SurfSet.cpp.

int DVision::SurfSet::GetDescriptorLength ( ) const [inline]

Returns the length of the descriptor vectors of the SURF features or 0 if no features have been extracted yet

Returns:
descriptor vector length

Definition at line 78 of file SurfSet.h.

int SurfSet::getPointOctave ( const CvSURFPoint &  kpt,
const CvSURFParams &  params 
)

Compute the octave of the SURF points.

Parameters:
kptis a keypoint
params

Definition at line 625 of file SurfSet.cpp.

int SurfSet::getPointOctave ( const CvSURFPoint &  kpt,
const CvSURFParams &  params 
) const [protected]

Returns the octave of a surf keypoint

Parameters:
kptkeypoint
paramsextractor parameters
Note:
This function is copied from the opencv surf.cpp file, written by Liu Liu

Definition at line 674 of file SurfSet.cpp.

void SurfSet::Load ( const std::string &  filename)

Loads the features from filename and removes the current ones

Parameters:
filename

Definition at line 618 of file SurfSet.cpp.

void SurfSet::load ( cv::FileStorage &  fs,
int  idx 
) [protected]

Loads the surfset from the given file storage The keys are created with the suffix idx

Parameters:
fs

Definition at line 649 of file SurfSet.cpp.

void SurfSet::LoadCustom ( const std::string &  filename)

Loads the features from a custom file, removing the current ones

Parameters:
filename
Note:
This function is DEPRECATED

Definition at line 74 of file SurfSet.cpp.

Creates the flann index to compute approximate correspondences. This function is called automatically the first time when CalculateCorrespondences is invoked in the approximate mode

Definition at line 566 of file SurfSet.cpp.

void SurfSet::Save ( const std::string &  filename) const

Saves the features into a file with a OpenCV writer

Parameters:
filename

Definition at line 580 of file SurfSet.cpp.

void SurfSet::save ( cv::FileStorage &  fs,
int  idx 
) const [protected]

Saves the surfset in the given file storage The keys are created with the suffix idx

Parameters:
fs

Definition at line 588 of file SurfSet.cpp.

void SurfSet::SaveCustom ( const std::string &  filename) const

Saves the features into a file in a custom format

Parameters:
filename
Note:
This function is DEPRECATED
The file format starts with 2 integers giving the total number of keypoints and the size of descriptor vector for each keypoint. Then each keypoint is specified by the following fields: x y angle size hessian octave laplacian_sign descriptor_vector

Definition at line 42 of file SurfSet.cpp.

unsigned int DVision::SurfSet::size ( ) const [inline]

Returns the number of keypoints in the set

Definition at line 87 of file SurfSet.h.


Friends And Related Function Documentation

friend class Matches [friend]

Definition at line 166 of file SurfSet.h.


Member Data Documentation

Definition at line 44 of file SurfSet.h.

Definition at line 43 of file SurfSet.h.

Definition at line 45 of file SurfSet.h.

Definition at line 232 of file SurfSet.h.


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


re_vision
Author(s): Dorian Galvez-Lopez
autogenerated on Sun Jan 5 2014 11:34:30