#include <SurfSet.h>
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 ¶ms) |
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 ¶ms) const |
void | load (cv::FileStorage &fs, int idx) |
void | save (cv::FileStorage &fs, int idx) const |
Protected Attributes | |
cv::flann::Index * | m_index |
Friends | |
class | Matches |
DVision::SurfSet::SurfSet | ( | ) | [inline] |
virtual DVision::SurfSet::~SurfSet | ( | ) | [inline, virtual] |
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
B | other set |
A_corr | indices of matched points from this set |
B_corr | indices of matched points from the set B |
distances | if given, the distance between the correspondences is stored here |
remove_duplicates | if true, ambiguous matches are discarded |
max_ratio | max 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
B | other set |
A_corr | indices of matched points from this set |
B_corr | indices of matched points from the set B |
distances | the distance between the correspondences is stored here |
remove_duplicates | if true, ambiguous matches are discarded |
max_ratio | max 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
B | other set |
A_corr | indices of matched points from this set |
B_corr | indices of matched points from the set B |
distances | the distance between the correspondences is stored here |
remove_duplicates | if true, ambiguous matches are discarded |
max_ratio | max 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
B | other set |
A_corr | indices of matched points from this set |
B_corr | indices of matched points from the set B |
distances | if given, the distance between the correspondences is stored here |
remove_duplicates | if true, ambiguous matches are discarded |
max_ratio | max 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
ita | beginning of one descriptor |
itb | beginning of the other descriptor |
L | length 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
image | |
keypoints | |
extended | if true, 128-dimensional surf are used instead of 64-d |
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
image | |
surf | surf data |
hessianTh | hessian threshold |
extended | if true, 128-dimensional surf are used instead of 64-d |
Definition at line 112 of file SurfSet.cpp.
int DVision::SurfSet::GetDescriptorLength | ( | ) | const [inline] |
int SurfSet::getPointOctave | ( | const CvSURFPoint & | kpt, |
const CvSURFParams & | params | ||
) |
Compute the octave of the SURF points.
kpt | is 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
kpt | keypoint |
params | extractor parameters |
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
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
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
filename |
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
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
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
filename |
Definition at line 42 of file SurfSet.cpp.
unsigned int DVision::SurfSet::size | ( | ) | const [inline] |
std::vector<cv::KeyPoint> DVision::SurfSet::keys |
cv::flann::Index* DVision::SurfSet::m_index [protected] |