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

Detailed Description

Collaboration diagram for Multiresolution SIFTs (experimental):

Typedefs

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

Functions

void mrpt::vision::saveQTableToFile (const TQuantizationTable &qTable, const std::string &filename)
 
void mrpt::vision::insertHashCoeffs (const CFeature::Ptr &feat, TQuantizationTable &qTable)
 
TMultiResMatchingOutput mrpt::vision::relocalizeMultiDesc (const mrpt::img::CImage &image, CFeatureList &baseList, CFeatureList &currentList, TQuantizationTable &qTable, const TMultiResDescOptions &desc_opts, const TMultiResDescMatchOptions &match_opts)
 
void mrpt::vision::updateBaseList (CFeatureList &baseList, const CFeatureList &currentList, const std::vector< int > &idx)
 
void mrpt::vision::checkScalesAndFindMore (CMatchedFeatureList &baseList, const CFeatureList &currentList, const mrpt::img::CImage &currentImage, const TMultiResMatchingOutput &output, const TMultiResDescOptions &computeOpts, const TMultiResDescMatchOptions &matchOpts)
 
bool mrpt::vision::computeGradient (const mrpt::img::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 mrpt::vision::computeMainOrientations (const mrpt::img::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 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 mrpt::vision::computeHistogramOfOrientations (const mrpt::img::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 mrpt::vision::matchMultiResolutionFeatures (const CFeatureList &list1, CFeatureList &list2, const mrpt::img::CImage &rightImage, const TMultiResDescMatchOptions &matchOpts, const TMultiResDescOptions &computeOpts)
 Matches two CFeatureList containing mulit-resolution descriptors. More...
 
int mrpt::vision::matchMultiResolutionFeatures (CMatchedFeatureList &mList1, CMatchedFeatureList &mList2, const mrpt::img::CImage &leftImage, const mrpt::img::CImage &rightImage, const TMultiResDescMatchOptions &matchOpts, const TMultiResDescOptions &computeOpts)
 Matches two CMatchedFeatureList containing mulit-resolution descriptors. More...
 
int mrpt::vision::computeMoreDescriptors (const mrpt::img::CImage &image, const CFeature::Ptr &inputFeat, CFeature::Ptr &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 mrpt::vision::setProperScales (const CFeature::Ptr &feat1, const CFeature::Ptr &feat2, int &firstScale, int &lastScale)
 Computes the initial and final scales where to look when finding a match between multi-resolution features. More...
 
void mrpt::vision::computeMultiResolutionDescriptors (const mrpt::img::CImage &imageLeft, const mrpt::img::CImage &imageRight, CMatchedFeatureList &matchedFeats, const TMultiResDescOptions &opts)
 Computes the multi-resolution SIFT-like descriptor of a set of matched features. More...
 
bool mrpt::vision::computeMultiResolutionDescriptors (const mrpt::img::CImage &image, CFeature::Ptr &feat, const TMultiResDescOptions &opts)
 Computes the multi-resolution SIFT-like descriptor of a features. More...
 
std::vector< bool > mrpt::vision::computeMultiResolutionDescriptors (const mrpt::img::CImage &image, CFeatureList &list, const TMultiResDescOptions &opts)
 Computes the multi-resolution SIFT-like descriptor of a list of features. More...
 
void mrpt::vision::computeMultiOrientations (const mrpt::img::CImage &image, CFeatureList &list, const TMultiResDescOptions &opts)
 Computes the multi-resolution SIFT-like descriptor of a list of features. More...
 

Typedef Documentation

◆ TQuantizationTable

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

Definition at line 36 of file multiDesc_utils.h.

Function Documentation

◆ checkScalesAndFindMore()

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

◆ computeGradient()

bool mrpt::vision::computeGradient ( const mrpt::img::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 558 of file multiDesc_utils.cpp.

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

◆ computeHistogramOfOrientations()

void mrpt::vision::computeHistogramOfOrientations ( const mrpt::img::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 819 of file multiDesc_utils.cpp.

References mrpt::vision::computeGradient(), mrpt::vision::TMultiResDescOptions::computeHashCoeffs, mrpt::vision::TMultiResDescOptions::cropValue, mrpt::system::CTimeLogger::disable(), mrpt::img::CImage::extract_patch(), mrpt::img::CImage::getAsFloat(), mrpt::vision::interpolateHistEntry(), M_2PI, min, MRPT_END, MRPT_START, mrpt::vision::normalizeImage(), mrpt::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::img::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 598 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::img::CImage image,
const CFeature::Ptr inputFeat,
CFeature::Ptr 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 1628 of file multiDesc_utils.cpp.

References ASSERT_, mrpt::vision::TMultiResDescOptions::basePSize, mrpt::vision::computeHistogramOfOrientations(), mrpt::vision::computeMainOrientations(), mrpt::img::CImage::extract_patch(), mrpt::img::CImage::getAs(), mrpt::img::CImage::getHeight(), mrpt::img::CImage::getWidth(), MRPT_END, MRPT_START, mrpt::system::pause(), mrpt::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::img::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 2262 of file multiDesc_utils.cpp.

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

◆ computeMultiResolutionDescriptors() [1/3]

bool mrpt::vision::computeMultiResolutionDescriptors ( const mrpt::img::CImage image,
CFeature::Ptr 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 2101 of file multiDesc_utils.cpp.

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

◆ computeMultiResolutionDescriptors() [2/3]

vector< bool > mrpt::vision::computeMultiResolutionDescriptors ( const mrpt::img::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 2216 of file multiDesc_utils.cpp.

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

◆ computeMultiResolutionDescriptors() [3/3]

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

◆ insertHashCoeffs()

void mrpt::vision::insertHashCoeffs ( const CFeature::Ptr 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 716 of file multiDesc_utils.cpp.

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

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

◆ matchMultiResolutionFeatures() [1/2]

int mrpt::vision::matchMultiResolutionFeatures ( CMatchedFeatureList mList1,
CMatchedFeatureList mList2,
const mrpt::img::CImage leftImage,
const mrpt::img::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 1424 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().

◆ matchMultiResolutionFeatures() [2/2]

TMultiResMatchingOutput mrpt::vision::matchMultiResolutionFeatures ( const CFeatureList list1,
CFeatureList list2,
const mrpt::img::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

cout << "New match found: [R] " << minRightIdx < " with [L] " << minLeftIdx << "(" << minVal << ")" << endl;

Definition at line 1020 of file multiDesc_utils.cpp.

References mrpt::vision::TMultiResDescOptions::basePSize, mrpt::vision::CFeatureList::begin(), mrpt::vision::computeHistogramOfOrientations(), mrpt::vision::computeMainOrientations(), mrpt::system::CTimeLogger::disable(), mrpt::vision::CFeatureList::end(), FEAT_FREE, mrpt::vision::TMultiResMatchingOutput::firstListCorrespondences, mrpt::vision::TMultiResMatchingOutput::firstListDistance, mrpt::vision::TMultiResMatchingOutput::firstListFoundScales, mrpt::img::CImage::getHeight(), mrpt::img::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::square(), and mrpt::vision::TMultiResDescMatchOptions::useDepthFilter.

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

◆ relocalizeMultiDesc()

TMultiResMatchingOutput mrpt::vision::relocalizeMultiDesc ( const mrpt::img::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 CFeature::Ptr feat1,
const CFeature::Ptr 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 1831 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.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST