Template Class TMatchingPairListTempl

Inheritance Relationships

Base Type

  • public std::vector< TMatchingPairTempl< T > >

Class Documentation

template<typename T>
class TMatchingPairListTempl : public std::vector<TMatchingPairTempl<T>>

A list of TMatchingPair.

Public Types

using base_t = std::vector<TMatchingPairTempl<T>>

Public Functions

bool indexOtherMapHasCorrespondence(size_t idx) const

Checks if the given index from the “other” map appears in the list.

void dumpToFile(const std::string &fileName) const

Saves the correspondences to a text file, with each line containing these columns: globalIdx localIdx gx gy gz lx ly lz errSqr

You can also use:

for (const auto &c: corrs)
 std::cout << c << "\n";
for a human-friendly description of contents.

void saveAsMATLABScript(const std::string &filName) const

Saves the correspondences as a MATLAB script which draws them.

T overallSquareError(const mrpt::poses::CPose2D &q) const

Computes the overall square error between the 2D points in the list of correspondences, given the 2D transformation “q”

\[ \sum\limits_i e_i \]
Where \( e_i \) are the elements of the square error vector as computed by squareErrorVector()

T overallSquareError(const mrpt::poses::CPose3D &q) const
T overallSquareErrorAndPoints(const mrpt::poses::CPose2D &q, std::vector<T> &xs, std::vector<T> &ys) const

Computes the overall square error between the 2D points in the list of correspondences, given the 2D transformation “q”, and return the transformed points as well.

\[ \sum\limits_i e_i \]
Where \( e_i \) are the elements of the square error vector as computed by squareErrorVector()

void squareErrorVector(const mrpt::poses::CPose2D &q, std::vector<T> &out_sqErrs) const

Returns a vector with the square error between each pair of correspondences in the list, given the SE(2) transformation q Each element \( e_i \) is the square distance between the “this” (global) point and the “other” (local) point transformed through “q”:

\[ e_i = | x_{this} - q \oplus x_{other} |^2 \]

void squareErrorVector(const mrpt::poses::CPose3D &q, std::vector<T> &out_sqErrs) const
void squareErrorVector(const mrpt::poses::CPose2D &q, std::vector<T> &out_sqErrs, std::vector<T> &xs, std::vector<T> &ys) const

Returns a vector with the square error between each pair of correspondences in the list and the transformed “other” (local) points, given the 2D transformation “q” Each element \( e_i \) is the square distance between the “this” (global) point and the “other” (local) point transformed through “q”:

\[ e_i = | x_{this} - q \oplus x_{other} |^2 \]

bool contains(const TMatchingPairTempl<T> &p) const

Test whether the given pair “p” is within the pairings

void filterUniqueRobustPairs(size_t num_elements_this_map, TMatchingPairListTempl<T> &out_filtered_list) const

Creates a filtered list of pairings with those ones which have a single correspondence which coincides in both directions, i.e. the best pairing of element i in map this is the best match for element j in map other, and viceversa