MRPT
1.9.9
|
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 ¤tList, TQuantizationTable &qTable, const TMultiResDescOptions &desc_opts, const TMultiResDescMatchOptions &match_opts) |
void | mrpt::vision::updateBaseList (CFeatureList &baseList, const CFeatureList ¤tList, const std::vector< int > &idx) |
void | mrpt::vision::checkScalesAndFindMore (CMatchedFeatureList &baseList, const CFeatureList ¤tList, const mrpt::img::CImage ¤tImage, 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... | |
using mrpt::vision::TQuantizationTable = typedef std::map< int, std::map<int, std::map<int, std::deque<std::pair<TFeatureID, double> >> >> |
Definition at line 34 of file multiDesc_utils.h.
void mrpt::vision::checkScalesAndFindMore | ( | CMatchedFeatureList & | baseList, |
const CFeatureList & | currentList, | ||
const mrpt::img::CImage & | currentImage, | ||
const TMultiResMatchingOutput & | output, | ||
const TMultiResDescOptions & | computeOpts, | ||
const TMultiResDescMatchOptions & | matchOpts | ||
) |
Definition at line 469 of file multiDesc_utils.cpp.
References ASSERT_, mrpt::vision::computeMoreDescriptors(), FEAT_FREE, mrpt::vision::TMultiResMatchingOutput::firstListCorrespondences, mrpt::vision::TMultiResMatchingOutput::firstListFoundScales, mrpt::vision::TMultiResDescMatchOptions::lastSeenThreshold, and mrpt::vision::TMultiResDescMatchOptions::timesSeenThreshold.
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.
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. |
Definition at line 558 of file multiDesc_utils.cpp.
Referenced by mrpt::vision::computeHistogramOfOrientations(), and mrpt::vision::computeMainOrientations().
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.
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. |
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().
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)
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().
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.
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().
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.
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. |
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.
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.
imageLeft | [IN] The input left image. |
imageRight | [IN] The input right image. |
matchedFeats | [IN/OUT] The list of matched features. They will be updated with the multi-scales, multi-orientations, multi-descriptors and depth information. |
opts | [IN] The options structure for the descriptor computation process. |
Definition at line 1896 of file multiDesc_utils.cpp.
References ASSERT_, mrpt::vision::TMultiResDescOptions::baseline, mrpt::vision::TMultiResDescOptions::basePSize, mrpt::vision::TMultiResDescOptions::computeDepth, mrpt::vision::computeHistogramOfOrientations(), mrpt::vision::computeMainOrientations(), mrpt::vision::TMultiResDescOptions::cx, mrpt::vision::TMultiResDescOptions::cy, mrpt::system::CTimeLogger::disable(), mrpt::img::CImage::extract_patch(), mrpt::vision::TMultiResDescOptions::fx, 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, and THROW_EXCEPTION.
Referenced by mrpt::vision::computeMultiResolutionDescriptors(), and mrpt::vision::relocalizeMultiDesc().
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.
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. |
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.
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.
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. |
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_END, MRPT_START, mrpt::vision::TMultiResDescOptions::sg1, mrpt::vision::CFeatureList::size(), and THROW_EXCEPTION.
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.
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.
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().
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.
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. |
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().
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
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. |
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().
TMultiResMatchingOutput mrpt::vision::relocalizeMultiDesc | ( | const mrpt::img::CImage & | image, |
CFeatureList & | baseList, | ||
CFeatureList & | currentList, | ||
TQuantizationTable & | qTable, | ||
const TMultiResDescOptions & | desc_opts, | ||
const TMultiResDescMatchOptions & | match_opts | ||
) |
Definition at line 129 of file multiDesc_utils.cpp.
References ASSERT_, mrpt::vision::TMultiResDescOptions::basePSize, mrpt::vision::CFeatureList::begin(), mrpt::vision::computeMultiResolutionDescriptors(), counter, mrpt::DEG2RAD(), mrpt::vision::CFeatureList::end(), mrpt::vision::TMultiResMatchingOutput::firstListCorrespondences, mrpt::vision::TMultiResMatchingOutput::firstListDistance, mrpt::vision::TMultiResMatchingOutput::firstListFoundScales, mrpt::vision::CFeatureList::getByID(), mrpt::vision::TMultiResDescMatchOptions::matchingThreshold, MRPT_END, MRPT_START, mrpt::vision::TMultiResMatchingOutput::nMatches, mrpt::vision::TMultiResDescOptions::scales, mrpt::vision::TMultiResMatchingOutput::secondListCorrespondences, mrpt::vision::CFeatureList::size(), and TH.
void mrpt::vision::saveQTableToFile | ( | const TQuantizationTable & | qTable, |
const std::string & | filename | ||
) |
Definition at line 97 of file multiDesc_utils.cpp.
References mrpt::system::os::fclose(), mrpt::system::os::fopen(), and mrpt::system::os::fprintf().
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.
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().
void mrpt::vision::updateBaseList | ( | CFeatureList & | baseList, |
const CFeatureList & | currentList, | ||
const std::vector< int > & | idx | ||
) |
Definition at line 409 of file multiDesc_utils.cpp.
References ASSERT_, counter, FEAT_FREE, mrpt::math::meanAndStd(), MRPT_END, MRPT_START, and mrpt::vision::CFeatureList::size().
Referenced by mrpt::vision::matchMultiResolutionFeatures().
Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: 7d5e6d718 Fri Aug 24 01:51:28 2018 +0200 at lun nov 2 08:35:50 CET 2020 |