Main MRPT website > C++ reference for MRPT 1.5.7
Typedefs | Functions
Multiresolution SIFTs (experimental)

Detailed Description

Collaboration diagram for Multiresolution SIFTs (experimental):

Typedefs

typedef std::map< int, std::map< int, std::map< int, std::deque< std::pair< TFeatureID, double > > > > > mrpt::vision::TQuantizationTable
 

Functions

void VISION_IMPEXP mrpt::vision::saveQTableToFile (const TQuantizationTable &qTable, const std::string &filename)
 
void VISION_IMPEXP mrpt::vision::insertHashCoeffs (const CFeaturePtr &feat, TQuantizationTable &qTable)
 
TMultiResMatchingOutput VISION_IMPEXP mrpt::vision::relocalizeMultiDesc (const mrpt::utils::CImage &image, CFeatureList &baseList, CFeatureList &currentList, TQuantizationTable &qTable, const TMultiResDescOptions &desc_opts, const TMultiResDescMatchOptions &match_opts)
 
void VISION_IMPEXP mrpt::vision::updateBaseList (CFeatureList &baseList, const CFeatureList &currentList, const std::vector< int > &idx)
 
void VISION_IMPEXP mrpt::vision::checkScalesAndFindMore (CMatchedFeatureList &baseList, const CFeatureList &currentList, const mrpt::utils::CImage &currentImage, const TMultiResMatchingOutput &output, const TMultiResDescOptions &computeOpts, const TMultiResDescMatchOptions &matchOpts)
 
bool VISION_IMPEXP mrpt::vision::computeGradient (const mrpt::utils::CImage &image, const unsigned int x, const unsigned int y, double &mag, double &ori)
 Computes the gradient of certain pixel within the image. More...
 
bool VISION_IMPEXP mrpt::vision::computeMainOrientations (const mrpt::utils::CImage &image, const unsigned int x, const unsigned int y, const unsigned int patchSize, std::vector< double > &orientations, const double &sigma)
 Computes the main orientations (within 80% of the peak value of orientation histogram) of a certain point within an image (for using in SIFT-based algorithms) More...
 
void VISION_IMPEXP mrpt::vision::interpolateHistEntry (std::vector< double > &hist, const double &cbin, const double &rbin, const double &obin, const double &mag, const int d, const int n)
 Inserts the orientation value of a certain pixel within the keypoint neighbourhood into the histogram of orientations. More...
 
void VISION_IMPEXP mrpt::vision::computeHistogramOfOrientations (const mrpt::utils::CImage &image, const unsigned int x, const unsigned int y, const unsigned int patchSize, const double &orientation, std::vector< int32_t > &descriptor, const TMultiResDescOptions &opts, std::vector< int32_t > &hashCoeffs)
 Computes the SIFT-like descriptor of a certain point within an image at the base scale, i.e. More...
 
TMultiResMatchingOutput VISION_IMPEXP mrpt::vision::matchMultiResolutionFeatures (const CFeatureList &list1, CFeatureList &list2, const mrpt::utils::CImage &rightImage, const TMultiResDescMatchOptions &matchOpts, const TMultiResDescOptions &computeOpts)
 Matches two CFeatureList containing mulit-resolution descriptors. More...
 
int VISION_IMPEXP mrpt::vision::matchMultiResolutionFeatures (CMatchedFeatureList &mList1, CMatchedFeatureList &mList2, const mrpt::utils::CImage &leftImage, const mrpt::utils::CImage &rightImage, const TMultiResDescMatchOptions &matchOpts, const TMultiResDescOptions &computeOpts)
 Matches two CMatchedFeatureList containing mulit-resolution descriptors. More...
 
int VISION_IMPEXP mrpt::vision::computeMoreDescriptors (const mrpt::utils::CImage &image, const CFeaturePtr &inputFeat, CFeaturePtr &outputFeat, const bool &lowerScales, const TMultiResDescOptions &opts)
 Computes more multi-resolution SIFT-like descriptors for a feature using its position in a new image. More...
 
void VISION_IMPEXP mrpt::vision::setProperScales (const CFeaturePtr &feat1, const CFeaturePtr &feat2, int &firstScale, int &lastScale)
 Computes the initial and final scales where to look when finding a match between multi-resolution features. More...
 
void VISION_IMPEXP mrpt::vision::computeMultiResolutionDescriptors (const mrpt::utils::CImage &imageLeft, const mrpt::utils::CImage &imageRight, CMatchedFeatureList &matchedFeats, const TMultiResDescOptions &opts)
 Computes the multi-resolution SIFT-like descriptor of a set of matched features. More...
 
bool VISION_IMPEXP mrpt::vision::computeMultiResolutionDescriptors (const mrpt::utils::CImage &image, CFeaturePtr &feat, const TMultiResDescOptions &opts)
 Computes the multi-resolution SIFT-like descriptor of a features. More...
 
std::vector< bool > VISION_IMPEXP mrpt::vision::computeMultiResolutionDescriptors (const mrpt::utils::CImage &image, CFeatureList &list, const TMultiResDescOptions &opts)
 Computes the multi-resolution SIFT-like descriptor of a list of features. More...
 
void VISION_IMPEXP mrpt::vision::computeMultiOrientations (const mrpt::utils::CImage &image, CFeatureList &list, const TMultiResDescOptions &opts)
 Computes the multi-resolution SIFT-like descriptor of a list of features. More...
 

Typedef Documentation

◆ TQuantizationTable

typedef std::map<int,std::map<int,std::map<int,std::deque<std::pair<TFeatureID, double> > > > > mrpt::vision::TQuantizationTable

Definition at line 36 of file multiDesc_utils.h.

Function Documentation

◆ checkScalesAndFindMore()

void mrpt::vision::checkScalesAndFindMore ( CMatchedFeatureList baseList,
const CFeatureList currentList,
const mrpt::utils::CImage currentImage,
const TMultiResMatchingOutput output,
const TMultiResDescOptions computeOpts,
const TMultiResDescMatchOptions matchOpts 
)

◆ computeGradient()

bool mrpt::vision::computeGradient ( const mrpt::utils::CImage image,
const unsigned int  x,
const unsigned int  y,
double &  mag,
double &  ori 
)

Computes the gradient of certain pixel within the image.

Parameters
image[IN] The input image.
x[IN] The 'x' coordinate of the image point.
y[IN] The 'y' coordinate of the image point.
mag[OUT] The magnitude of the gradient.
ori[OUT] The orientation of the gradient.
Returns
True if the gradient could be computed and False if the pixel is located outside the image or at its border (where the gradient cannot be computed)

Definition at line 458 of file multiDesc_utils.cpp.

Referenced by mrpt::vision::computeHistogramOfOrientations(), and mrpt::vision::computeMainOrientations().

◆ computeHistogramOfOrientations()

void mrpt::vision::computeHistogramOfOrientations ( const mrpt::utils::CImage image,
const unsigned int  x,
const unsigned int  y,
const unsigned int  patchSize,
const double &  orientation,
std::vector< int32_t > &  descriptor,
const TMultiResDescOptions opts,
std::vector< int32_t > &  hashCoeffs 
)

Computes the SIFT-like descriptor of a certain point within an image at the base scale, i.e.

its rotated orientation histogram.

Parameters
image[IN] The input image.
x[IN] The 'x' coordinate of the image point.
y[IN] The 'y' coordinate of the image point.
patchSize[IN] The size of the patch to be considered for computing the orientation histogram.
orientation[IN] The orientation considered for this point (used to rotate the patch).
orientation[OUT] The computed SIFT-like descriptor.
opts[IN] The options for computing the SIFT-like descriptor.
hashCoeffs[OUT] A vector containing the computed coefficients for the HASH table used in relocalization.
See also
TMultiResDescOptions

Definition at line 688 of file multiDesc_utils.cpp.

References mrpt::vision::computeGradient(), mrpt::vision::TMultiResDescOptions::computeHashCoeffs, mrpt::vision::TMultiResDescOptions::cropValue, mrpt::utils::CTimeLogger::disable(), mrpt::utils::CImage::extract_patch(), mrpt::utils::CImage::getAsFloat(), mrpt::vision::interpolateHistEntry(), M_2PI, min, MRPT_END, MRPT_START, mrpt::vision::normalizeImage(), mrpt::utils::round(), mrpt::vision::TMultiResDescOptions::sg3, and mrpt::math::sum().

Referenced by mrpt::vision::computeMoreDescriptors(), mrpt::vision::computeMultiResolutionDescriptors(), and mrpt::vision::matchMultiResolutionFeatures().

◆ computeMainOrientations()

bool mrpt::vision::computeMainOrientations ( const mrpt::utils::CImage image,
const unsigned int  x,
const unsigned int  y,
const unsigned int  patchSize,
std::vector< double > &  orientations,
const double &  sigma 
)

Computes the main orientations (within 80% of the peak value of orientation histogram) of a certain point within an image (for using in SIFT-based algorithms)

Parameters
image[IN] The input image.
x[IN] The 'x' coordinate of the image point.
y[IN] The 'y' coordinate of the image point.
patchSize[IN] The size of the patch to be considered for computing the orientation histogram.
orientations[OUT] A vector containing the main orientations of the image point.
sigma[IN] The sigma value of the Gaussian kernel used to smooth the orientation histogram (typically 7.5 px).

Definition at line 496 of file multiDesc_utils.cpp.

References mrpt::vision::computeGradient(), M_2PI, M_PI, MRPT_END, and MRPT_START.

Referenced by mrpt::vision::computeMoreDescriptors(), mrpt::vision::computeMultiOrientations(), mrpt::vision::computeMultiResolutionDescriptors(), and mrpt::vision::matchMultiResolutionFeatures().

◆ computeMoreDescriptors()

int mrpt::vision::computeMoreDescriptors ( const mrpt::utils::CImage image,
const CFeaturePtr &  inputFeat,
CFeaturePtr &  outputFeat,
const bool &  lowerScales,
const TMultiResDescOptions opts 
)

Computes more multi-resolution SIFT-like descriptors for a feature using its position in a new image.

This is called when we have found a match between a feature and itself in a new frame but it has been found in a boundary scale. We now expand the range of scales, orientations and descriptors for that feature.

Parameters
image[IN] The new frame.
inputFeat[IN] The feature in the new frame.
outputFeat[OUT] The base feature (detected in the base frame).
lowerScales[IN] If we should find descriptors for lower scales or for higher ones.
opts[IN] The options for computing the new descriptors.

Definition at line 1338 of file multiDesc_utils.cpp.

References ASSERT_, mrpt::vision::TMultiResDescOptions::basePSize, mrpt::vision::computeHistogramOfOrientations(), mrpt::vision::computeMainOrientations(), mrpt::utils::CImage::extract_patch(), mrpt::utils::CImage::getAs(), mrpt::utils::CImage::getHeight(), mrpt::utils::CImage::getWidth(), MRPT_END, MRPT_START, mrpt::system::pause(), mrpt::utils::round(), mrpt::vision::TMultiResDescOptions::sg1, mrpt::vision::TMultiResDescOptions::sg2, and THROW_EXCEPTION.

Referenced by mrpt::vision::checkScalesAndFindMore(), and mrpt::vision::matchMultiResolutionFeatures().

◆ computeMultiOrientations()

void mrpt::vision::computeMultiOrientations ( const mrpt::utils::CImage image,
CFeatureList list,
const TMultiResDescOptions opts 
)

Computes the multi-resolution SIFT-like descriptor of a list of features.

Parameters
image[IN] The input image.
list[IN/OUT] The list of features. They will be updated with the multi-scales, multi-orientations and multi-descriptors information.
opts[IN] The options structure for the descriptor computation process.
See also
TMultiResDescOptions

Definition at line 1901 of file multiDesc_utils.cpp.

References ASSERT_, mrpt::vision::TMultiResDescOptions::basePSize, mrpt::vision::CFeatureList::begin(), mrpt::vision::computeMainOrientations(), mrpt::utils::CTimeLogger::disable(), mrpt::vision::CFeatureList::end(), mrpt::utils::CImage::extract_patch(), mrpt::utils::CImage::getAs(), mrpt::utils::CImage::getHeight(), mrpt::utils::CImage::getWidth(), mrpt::system::os::memcpy(), MRPT_END, MRPT_START, mrpt::utils::round(), mrpt::vision::TMultiResDescOptions::scales, mrpt::vision::TMultiResDescOptions::sg1, mrpt::vision::TMultiResDescOptions::sg2, mrpt::vision::CFeatureList::size(), and THROW_EXCEPTION.

◆ computeMultiResolutionDescriptors() [1/3]

void mrpt::vision::computeMultiResolutionDescriptors ( const mrpt::utils::CImage imageLeft,
const mrpt::utils::CImage imageRight,
CMatchedFeatureList matchedFeats,
const TMultiResDescOptions opts 
)

◆ computeMultiResolutionDescriptors() [2/3]

bool mrpt::vision::computeMultiResolutionDescriptors ( const mrpt::utils::CImage image,
CFeaturePtr &  feat,
const TMultiResDescOptions opts 
)

Computes the multi-resolution SIFT-like descriptor of a features.

Parameters
image[IN] The input left image.
feat[IN/OUT] The feature. It will be updated with the multi-scales, multi-orientations, multi-descriptors
opts[IN] The options structure for the descriptor computation process.
See also
TMultiResDescOptions

Definition at line 1749 of file multiDesc_utils.cpp.

References mrpt::vision::TMultiResDescOptions::basePSize, mrpt::vision::TMultiResDescOptions::computeHashCoeffs, mrpt::vision::computeHistogramOfOrientations(), mrpt::vision::computeMainOrientations(), mrpt::utils::CImage::getAs(), MRPT_END, MRPT_START, mrpt::utils::round(), mrpt::vision::TMultiResDescOptions::scales, mrpt::vision::TMultiResDescOptions::sg2, and THROW_EXCEPTION.

◆ computeMultiResolutionDescriptors() [3/3]

vector< bool > mrpt::vision::computeMultiResolutionDescriptors ( const mrpt::utils::CImage image,
CFeatureList list,
const TMultiResDescOptions opts 
)

Computes the multi-resolution SIFT-like descriptor of a list of features.

Parameters
image[IN] The input image.
list[IN/OUT] The list of features. They will be updated with the multi-scales, multi-orientations and multi-descriptors information.
opts[IN] The options structure for the descriptor computation process.
See also
TMultiResDescOptions

Definition at line 1855 of file multiDesc_utils.cpp.

References ASSERT_, mrpt::vision::CFeatureList::begin(), mrpt::vision::TMultiResDescOptions::blurImage, mrpt::vision::computeMultiResolutionDescriptors(), mrpt::utils::CTimeLogger::disable(), mrpt::vision::CFeatureList::end(), MRPT_END, MRPT_START, mrpt::vision::TMultiResDescOptions::sg1, mrpt::vision::CFeatureList::size(), and THROW_EXCEPTION.

◆ insertHashCoeffs()

void mrpt::vision::insertHashCoeffs ( const CFeaturePtr &  feat,
TQuantizationTable qTable 
)

Definition at line 55 of file multiDesc_utils.cpp.

References MRPT_END, and MRPT_START.

◆ interpolateHistEntry()

void mrpt::vision::interpolateHistEntry ( std::vector< double > &  hist,
const double &  cbin,
const double &  rbin,
const double &  obin,
const double &  mag,
const int  d,
const int  n 
)

Inserts the orientation value of a certain pixel within the keypoint neighbourhood into the histogram of orientations.

This value can affect to more than one entry within the histogram.

Parameters
hist[IN/OUT] The histogram of orientations.
cbin[IN] The entry rotated column bin.
rbin[IN] The entry rotated row bin.
obin[IN] The entry rotated orientation bin.
mag[IN] The gradient magnitude value in the pixel.
d[IN] The number of row (and column) bins used in the histogram (typically 4).
n[IN] The number of orienation bins used in the histogram (typically 8).

Definition at line 591 of file multiDesc_utils.cpp.

References mrpt::utils::CTimeLogger::disable().

Referenced by mrpt::vision::computeHistogramOfOrientations().

◆ matchMultiResolutionFeatures() [1/2]

TMultiResMatchingOutput mrpt::vision::matchMultiResolutionFeatures ( const CFeatureList list1,
CFeatureList list2,
const mrpt::utils::CImage rightImage,
const TMultiResDescMatchOptions matchOpts,
const TMultiResDescOptions computeOpts 
)

Matches two CFeatureList containing mulit-resolution descriptors.

The first list is taken as a base, i.e. its features must contain multi-resolution descriptors at a set of different scales. The second list doesn't need to contain such information because it will be computed if necessary according to the the fulfillment of some restriction regarding the matching process. This function will try to find the best matches within list2 corresponding to the features within base list list1.

Parameters
list1[IN] The base list of features.
list2[IN/OUT] The other list of features.
rightImage[IN] The image from where the list2 was extracted. It's used to compute the descriptor of these features if necessary.
output[OUT] The output structure with the matching information.
matchOpts[IN] The options structure for the matching process.
computeOpts[IN] The options structure for the descriptor computation process.
Returns
A structure containing the results of the matching.
See also
TMultiResDescMatchOptions, TMultiResDescOptions, TMultiResMatchingOutput

Definition at line 875 of file multiDesc_utils.cpp.

References mrpt::vision::TMultiResDescOptions::basePSize, mrpt::vision::CFeatureList::begin(), mrpt::vision::computeHistogramOfOrientations(), mrpt::vision::computeMainOrientations(), mrpt::utils::CTimeLogger::disable(), mrpt::vision::CFeatureList::end(), FEAT_FREE, mrpt::vision::TMultiResMatchingOutput::firstListCorrespondences, mrpt::vision::TMultiResMatchingOutput::firstListDistance, mrpt::vision::TMultiResMatchingOutput::firstListFoundScales, mrpt::utils::CImage::getHeight(), mrpt::utils::CImage::getWidth(), mrpt::vision::TMultiResDescMatchOptions::highScl1, mrpt::math::KDTreeCapable< Derived, num_t, metric_t >::kdTreeNClosestPoint2DIdx(), mrpt::vision::TMultiResDescMatchOptions::lastSeenThreshold, mrpt::vision::TMultiResDescMatchOptions::lowScl1, M_2PI, mrpt::vision::TMultiResDescMatchOptions::matchingThreshold, min, MRPT_END, MRPT_START, mrpt::vision::TMultiResMatchingOutput::nMatches, mrpt::vision::TMultiResDescMatchOptions::oriThreshold, mrpt::system::pause(), mrpt::vision::TMultiResDescMatchOptions::searchAreaSize, mrpt::vision::TMultiResMatchingOutput::secondListCorrespondences, mrpt::vision::setProperScales(), mrpt::vision::TMultiResDescOptions::sg2, mrpt::vision::CFeatureList::size(), mrpt::math::square(), and mrpt::vision::TMultiResDescMatchOptions::useDepthFilter.

Referenced by mrpt::vision::matchMultiResolutionFeatures().

◆ matchMultiResolutionFeatures() [2/2]

int mrpt::vision::matchMultiResolutionFeatures ( CMatchedFeatureList mList1,
CMatchedFeatureList mList2,
const mrpt::utils::CImage leftImage,
const mrpt::utils::CImage rightImage,
const TMultiResDescMatchOptions matchOpts,
const TMultiResDescOptions computeOpts 
)

Matches two CMatchedFeatureList containing mulit-resolution descriptors.

This is performed for both the "left" and "right" lists The first matched list is taken as a base, i.e. its features must contain multi-resolution descriptors at a set of different scales. The second list doesn't need to contain such information because it will be computed if necessary according to the the fulfillment of some restriction regarding the matching process. This function will try to find the best matches within list2 corresponding to the features

Parameters
mList1[IN] The base list.
mList2[IN] The other list of features.
leftImage[IN] The image from where the list2 was extracted. It's used to compute the descriptor of these features if necessary.
rightImage[IN] The image from where the list2 was extracted. It's used to compute the descriptor of these features if necessary.
matchOpts[IN] The options structure for the matching process.
computeOpts[IN] The options structure for the descriptor computation process.
Returns
The number of matches found
See also
TMultiResDescMatchOptions

Definition at line 1179 of file multiDesc_utils.cpp.

References ASSERT_, mrpt::vision::computeMoreDescriptors(), FEAT_FREE, mrpt::vision::TMultiResMatchingOutput::firstListCorrespondences, mrpt::vision::CMatchedFeatureList::getBothFeatureLists(), mrpt::vision::TMultiResDescMatchOptions::lastSeenThreshold, mrpt::vision::matchMultiResolutionFeatures(), MRPT_END, MRPT_START, mrpt::vision::TMultiResMatchingOutput::nMatches, mrpt::vision::CFeatureList::size(), and mrpt::vision::updateBaseList().

◆ relocalizeMultiDesc()

TMultiResMatchingOutput mrpt::vision::relocalizeMultiDesc ( const mrpt::utils::CImage image,
CFeatureList baseList,
CFeatureList currentList,
TQuantizationTable qTable,
const TMultiResDescOptions desc_opts,
const TMultiResDescMatchOptions match_opts 
)

◆ saveQTableToFile()

void mrpt::vision::saveQTableToFile ( const TQuantizationTable qTable,
const std::string filename 
)

◆ setProperScales()

void mrpt::vision::setProperScales ( const CFeaturePtr &  feat1,
const CFeaturePtr &  feat2,
int &  firstScale,
int &  lastScale 
)

Computes the initial and final scales where to look when finding a match between multi-resolution features.

Both features must have their "depth" member properly computed.

Parameters
feat1[IN] The base feature which MUST contain a set of different scales.
feat2[IN] The other feature which must be computed at base scale (1.0).
firstScale[OUT] The initial scale (within [0 feat1->multiScale.size()-1]) where to look.
firstScale[OUT] The final scale (within [0 feat1->multiScale.size()-1]) where to look.

Definition at line 1514 of file multiDesc_utils.cpp.

References ASSERT_, MRPT_END, and MRPT_START.

Referenced by mrpt::vision::matchMultiResolutionFeatures().

◆ updateBaseList()

void mrpt::vision::updateBaseList ( CFeatureList baseList,
const CFeatureList currentList,
const std::vector< int > &  idx 
)



Page generated by Doxygen 1.8.14 for MRPT 1.5.7 Git: 5902e14cc Wed Apr 24 15:04:01 2019 +0200 at lun oct 28 01:39:17 CET 2019