template class mrpt::tfest::TMatchingPairListTempl

Overview

A list of TMatchingPair.

#include <mrpt/tfest/TMatchingPair.h>

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

    typedef std::vector<TMatchingPairTempl<T>> base_t;

    // methods

    bool indexOtherMapHasCorrespondence(size_t idx) const;
    void dumpToFile(const std::string& fileName) const;
    void saveAsMATLABScript(const std::string& filName) const;
    T overallSquareError(const mrpt::poses::CPose2D& q) const;
    T overallSquareError(const mrpt::poses::CPose3D& q) const;
    T overallSquareErrorAndPoints(const mrpt::poses::CPose2D& q, std::vector<T>& xs, std::vector<T>& ys) const;
    void squareErrorVector(const mrpt::poses::CPose2D& q, std::vector<T>& out_sqErrs) const;

    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;

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

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

Methods

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()

See also:

squareErrorVector, overallSquareErrorAndPoints

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()

See also:

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\]

See also:

overallSquareError

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\]

See also:

overallSquareError

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