OKVIS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | List of all members
okvis::VioKeyframeWindowMatchingAlgorithm< CAMERA_GEOMETRY_T > Class Template Reference

A MatchingAlgorithm implementation. More...

#include <VioKeyframeWindowMatchingAlgorithm.hpp>

Inheritance diagram for okvis::VioKeyframeWindowMatchingAlgorithm< CAMERA_GEOMETRY_T >:
okvis::MatchingAlgorithm

Public Types

enum  MatchingTypes { Match3D2D = 1, Match2D2D = 2 }
 
- Public Types inherited from okvis::MatchingAlgorithm
typedef std::shared_ptr
< MatchingAlgorithm
Ptr
 
typedef std::multimap< size_t,
size_t > 
listB_tree_structure_t
 Tree data structure for image space restricted matching mapping from image row to list of features (indices!) More...
 

Public Member Functions

 VioKeyframeWindowMatchingAlgorithm (okvis::Estimator &estimator, int matchingType, float distanceThreshold, bool usePoseUncertainty=true)
 Constructor. More...
 
virtual ~VioKeyframeWindowMatchingAlgorithm ()
 
void setFrames (uint64_t mfIdA, uint64_t mfIdB, size_t camIdA, size_t camIdB)
 Set which frames to match. More...
 
void setMatchingType (int matchingType)
 Set the matching type. More...
 
virtual void doSetup ()
 This will be called exactly once for each call to DenseMatcher::match(). More...
 
virtual size_t sizeA () const
 What is the size of list A? More...
 
virtual size_t sizeB () const
 What is the size of list B? More...
 
virtual float distanceThreshold () const
 Get the distance threshold for which matches exceeding it will not be returned as matches. More...
 
void setDistanceThreshold (float distanceThreshold)
 Set the distance threshold for which matches exceeding it will not be returned as matches. More...
 
virtual bool skipA (size_t indexA) const
 Should we skip the item in list A? This will be called once for each item in the list. More...
 
virtual bool skipB (size_t indexB) const
 Should we skip the item in list B? This will be called many times. More...
 
virtual float distance (size_t indexA, size_t indexB) const
 Calculate the distance between two keypoints. More...
 
bool verifyMatch (size_t indexA, size_t indexB) const
 Geometric verification of a match. More...
 
virtual void reserveMatches (size_t numMatches)
 A function that tells you how many times setMatching() will be called. More...
 
virtual void setBestMatch (size_t indexA, size_t indexB, double distance)
 At the end of the matching step, this function is called once for each pair of matches discovered. More...
 
size_t numMatches ()
 Get the number of matches. More...
 
size_t numUncertainMatches ()
 Get the number of uncertain matches. More...
 
const okvis::MatchesgetMatches () const
 access the matching result. More...
 
bool isRelativeUncertaintyValid ()
 assess the validity of the relative uncertainty computation. More...
 
- Public Member Functions inherited from okvis::MatchingAlgorithm
 MatchingAlgorithm ()
 
virtual ~MatchingAlgorithm ()
 
virtual
listB_tree_structure_t::iterator 
getListBStartIterator (size_t indexA)
 Get begin iterator for elements of listB to be matched against the given element from list A (indexA) for a given index of listA, get an iterator into the listB multimap to the start of all elements in listB that should be matched against indexA note: implement this in your matching algorithm subclass. More...
 
virtual
listB_tree_structure_t::iterator 
getListBEndIterator (size_t indexA)
 Get end iterator for elements of listB to be matched against the given element from list A (indexA) for a given index of listA, get an iterator into the listB multimap to the end of all elements in listB that should be matched against indexA. More...
 
virtual float distanceRatioThreshold () const
 By which factor does the first best match has to be better than the second best one. More...
 
float matchFailed () const
 What to return if the match failed. More...
 

Public Attributes

EIGEN_MAKE_ALIGNED_OPERATOR_NEW
typedef CAMERA_GEOMETRY_T 
camera_geometry_t
 

Private Member Functions

uint32_t specificDescriptorDistance (const unsigned char *descriptorA, const unsigned char *descriptorB) const
 Calculates the distance between two descriptors. More...
 

Private Attributes

okvis::Estimatorestimator_
 This is essentially the map. More...
 
float distanceThreshold_
 Distances above this threshold will not be returned as matches. More...
 
size_t numMatches_ = 0
 The number of matches. More...
 
size_t numUncertainMatches_ = 0
 The number of uncertain matches. More...
 
double fA_ = 0
 Focal length of camera used in frame A. More...
 
double fB_ = 0
 Focal length of camera used in frame B. More...
 
int matchingType_
 Stored the matching type. See MatchingTypes(). More...
 
Eigen::Matrix< double,
Eigen::Dynamic, 2 > 
projectionsIntoB_
 temporarily store all projections More...
 
Eigen::Matrix< double,
Eigen::Dynamic, 2 > 
projectionsIntoBUncertainties_
 temporarily store all projection uncertainties More...
 
std::vector< bool > skipA_
 Should keypoint[index] in frame A be skipped. More...
 
std::vector< bool > skipB_
 Should keypoint[index] in frame B be skipped. More...
 
Eigen::Vector3d pA_W_
 Camera center of frame A. More...
 
Eigen::Vector3d pB_W_
 Camera center of frame B. More...
 
std::vector< double > raySigmasA_
 Temporarily store ray sigmas of frame A. More...
 
std::vector< double > raySigmasB_
 Temporarily store ray sigmas of frame B. More...
 
okvis::triangulation::ProbabilisticStereoTriangulator
< camera_geometry_t
probabilisticStereoTriangulator_
 Stereo triangulator. More...
 
bool validRelativeUncertainty_ = false
 
bool usePoseUncertainty_ = false
 
Which frames to take
uint64_t mfIdA_ = 0
 
uint64_t mfIdB_ = 0
 
size_t camIdA_ = 0
 
size_t camIdB_ = 0
 
std::shared_ptr
< okvis::MultiFrame
frameA_
 
std::shared_ptr
< okvis::MultiFrame
frameB_
 
Store some transformations that are often used

use a fully relative formulation

okvis::kinematics::Transformation T_CaCb_
 
okvis::kinematics::Transformation T_CbCa_
 
okvis::kinematics::Transformation T_SaCa_
 
okvis::kinematics::Transformation T_SbCb_
 
okvis::kinematics::Transformation T_WSa_
 
okvis::kinematics::Transformation T_WSb_
 
okvis::kinematics::Transformation T_SaW_
 
okvis::kinematics::Transformation T_SbW_
 
okvis::kinematics::Transformation T_WCa_
 
okvis::kinematics::Transformation T_WCb_
 
okvis::kinematics::Transformation T_CaW_
 
okvis::kinematics::Transformation T_CbW_
 

Detailed Description

template<class CAMERA_GEOMETRY_T>
class okvis::VioKeyframeWindowMatchingAlgorithm< CAMERA_GEOMETRY_T >

A MatchingAlgorithm implementation.

Template Parameters
CAMERA_GEOMETRY_TCamera geometry model. See also okvis::cameras::CameraBase.

Member Enumeration Documentation

template<class CAMERA_GEOMETRY_T >
enum okvis::VioKeyframeWindowMatchingAlgorithm::MatchingTypes
Enumerator
Match3D2D 

Match 3D position of established landmarks to 2D keypoint position.

Match2D2D 

Match 2D position of established landmarks to 2D keypoint position.

Constructor & Destructor Documentation

template<class CAMERA_GEOMETRY_T >
okvis::VioKeyframeWindowMatchingAlgorithm< CAMERA_GEOMETRY_T >::VioKeyframeWindowMatchingAlgorithm ( okvis::Estimator estimator,
int  matchingType,
float  distanceThreshold,
bool  usePoseUncertainty = true 
)

Constructor.

Parameters
estimatorEstimator.
matchingTypeMatching type. See MatchingTypes enum.
distanceThresholdDescriptor distance threshold.
usePoseUncertaintyUse the pose uncertainty for matching.
template<class CAMERA_GEOMETRY_T >
okvis::VioKeyframeWindowMatchingAlgorithm< CAMERA_GEOMETRY_T >::~VioKeyframeWindowMatchingAlgorithm ( )
virtual

Member Function Documentation

template<class CAMERA_GEOMETRY_T >
virtual float okvis::VioKeyframeWindowMatchingAlgorithm< CAMERA_GEOMETRY_T >::distance ( size_t  indexA,
size_t  indexB 
) const
inlinevirtual

Calculate the distance between two keypoints.

Parameters
indexAIndex of the first keypoint.
indexBIndex of the other keypoint.
Returns
Distance between the two keypoint descriptors.
Remarks
Points that absolutely don't match will return float::max.

Implements okvis::MatchingAlgorithm.

template<class CAMERA_GEOMETRY_T >
float okvis::VioKeyframeWindowMatchingAlgorithm< CAMERA_GEOMETRY_T >::distanceThreshold ( ) const
virtual

Get the distance threshold for which matches exceeding it will not be returned as matches.

Reimplemented from okvis::MatchingAlgorithm.

template<class CAMERA_GEOMETRY_T >
void okvis::VioKeyframeWindowMatchingAlgorithm< CAMERA_GEOMETRY_T >::doSetup ( )
virtual

This will be called exactly once for each call to DenseMatcher::match().

Reimplemented from okvis::MatchingAlgorithm.

template<class CAMERA_GEOMETRY_T >
const okvis::Matches& okvis::VioKeyframeWindowMatchingAlgorithm< CAMERA_GEOMETRY_T >::getMatches ( ) const

access the matching result.

template<class CAMERA_GEOMETRY_T >
bool okvis::VioKeyframeWindowMatchingAlgorithm< CAMERA_GEOMETRY_T >::isRelativeUncertaintyValid ( )
inline

assess the validity of the relative uncertainty computation.

template<class CAMERA_GEOMETRY_T >
size_t okvis::VioKeyframeWindowMatchingAlgorithm< CAMERA_GEOMETRY_T >::numMatches ( )

Get the number of matches.

template<class CAMERA_GEOMETRY_T >
size_t okvis::VioKeyframeWindowMatchingAlgorithm< CAMERA_GEOMETRY_T >::numUncertainMatches ( )

Get the number of uncertain matches.

template<class CAMERA_GEOMETRY_T >
void okvis::VioKeyframeWindowMatchingAlgorithm< CAMERA_GEOMETRY_T >::reserveMatches ( size_t  numMatches)
virtual

A function that tells you how many times setMatching() will be called.

Warning
Currently not implemented to do anything.

Implements okvis::MatchingAlgorithm.

template<class CAMERA_GEOMETRY_T >
void okvis::VioKeyframeWindowMatchingAlgorithm< CAMERA_GEOMETRY_T >::setBestMatch ( size_t  indexA,
size_t  indexB,
double  distance 
)
virtual

At the end of the matching step, this function is called once for each pair of matches discovered.

Implements okvis::MatchingAlgorithm.

template<class CAMERA_GEOMETRY_T >
void okvis::VioKeyframeWindowMatchingAlgorithm< CAMERA_GEOMETRY_T >::setDistanceThreshold ( float  distanceThreshold)

Set the distance threshold for which matches exceeding it will not be returned as matches.

template<class CAMERA_GEOMETRY_T >
void okvis::VioKeyframeWindowMatchingAlgorithm< CAMERA_GEOMETRY_T >::setFrames ( uint64_t  mfIdA,
uint64_t  mfIdB,
size_t  camIdA,
size_t  camIdB 
)

Set which frames to match.

Parameters
mfIdAThe multiframe ID to match against.
mfIdBThe new multiframe ID.
camIdAID of the frame inside multiframe A to match.
camIdBID of the frame inside multiframe B to match.
template<class CAMERA_GEOMETRY_T >
void okvis::VioKeyframeWindowMatchingAlgorithm< CAMERA_GEOMETRY_T >::setMatchingType ( int  matchingType)

Set the matching type.

See Also
MatchingTypes
template<class CAMERA_GEOMETRY_T >
size_t okvis::VioKeyframeWindowMatchingAlgorithm< CAMERA_GEOMETRY_T >::sizeA ( ) const
virtual

What is the size of list A?

Implements okvis::MatchingAlgorithm.

template<class CAMERA_GEOMETRY_T >
size_t okvis::VioKeyframeWindowMatchingAlgorithm< CAMERA_GEOMETRY_T >::sizeB ( ) const
virtual

What is the size of list B?

Implements okvis::MatchingAlgorithm.

template<class CAMERA_GEOMETRY_T >
virtual bool okvis::VioKeyframeWindowMatchingAlgorithm< CAMERA_GEOMETRY_T >::skipA ( size_t  indexA) const
inlinevirtual

Should we skip the item in list A? This will be called once for each item in the list.

Reimplemented from okvis::MatchingAlgorithm.

template<class CAMERA_GEOMETRY_T >
virtual bool okvis::VioKeyframeWindowMatchingAlgorithm< CAMERA_GEOMETRY_T >::skipB ( size_t  indexB) const
inlinevirtual

Should we skip the item in list B? This will be called many times.

Reimplemented from okvis::MatchingAlgorithm.

template<class CAMERA_GEOMETRY_T >
uint32_t okvis::VioKeyframeWindowMatchingAlgorithm< CAMERA_GEOMETRY_T >::specificDescriptorDistance ( const unsigned char *  descriptorA,
const unsigned char *  descriptorB 
) const
inlineprivate

Calculates the distance between two descriptors.

template<class CAMERA_GEOMETRY_T >
bool okvis::VioKeyframeWindowMatchingAlgorithm< CAMERA_GEOMETRY_T >::verifyMatch ( size_t  indexA,
size_t  indexB 
) const

Geometric verification of a match.

Member Data Documentation

template<class CAMERA_GEOMETRY_T >
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef CAMERA_GEOMETRY_T okvis::VioKeyframeWindowMatchingAlgorithm< CAMERA_GEOMETRY_T >::camera_geometry_t
template<class CAMERA_GEOMETRY_T >
size_t okvis::VioKeyframeWindowMatchingAlgorithm< CAMERA_GEOMETRY_T >::camIdA_ = 0
private
template<class CAMERA_GEOMETRY_T >
size_t okvis::VioKeyframeWindowMatchingAlgorithm< CAMERA_GEOMETRY_T >::camIdB_ = 0
private
template<class CAMERA_GEOMETRY_T >
float okvis::VioKeyframeWindowMatchingAlgorithm< CAMERA_GEOMETRY_T >::distanceThreshold_
private

Distances above this threshold will not be returned as matches.

template<class CAMERA_GEOMETRY_T >
okvis::Estimator* okvis::VioKeyframeWindowMatchingAlgorithm< CAMERA_GEOMETRY_T >::estimator_
private

This is essentially the map.

template<class CAMERA_GEOMETRY_T >
double okvis::VioKeyframeWindowMatchingAlgorithm< CAMERA_GEOMETRY_T >::fA_ = 0
private

Focal length of camera used in frame A.

template<class CAMERA_GEOMETRY_T >
double okvis::VioKeyframeWindowMatchingAlgorithm< CAMERA_GEOMETRY_T >::fB_ = 0
private

Focal length of camera used in frame B.

template<class CAMERA_GEOMETRY_T >
std::shared_ptr<okvis::MultiFrame> okvis::VioKeyframeWindowMatchingAlgorithm< CAMERA_GEOMETRY_T >::frameA_
private
template<class CAMERA_GEOMETRY_T >
std::shared_ptr<okvis::MultiFrame> okvis::VioKeyframeWindowMatchingAlgorithm< CAMERA_GEOMETRY_T >::frameB_
private
template<class CAMERA_GEOMETRY_T >
int okvis::VioKeyframeWindowMatchingAlgorithm< CAMERA_GEOMETRY_T >::matchingType_
private

Stored the matching type. See MatchingTypes().

template<class CAMERA_GEOMETRY_T >
uint64_t okvis::VioKeyframeWindowMatchingAlgorithm< CAMERA_GEOMETRY_T >::mfIdA_ = 0
private
template<class CAMERA_GEOMETRY_T >
uint64_t okvis::VioKeyframeWindowMatchingAlgorithm< CAMERA_GEOMETRY_T >::mfIdB_ = 0
private
template<class CAMERA_GEOMETRY_T >
size_t okvis::VioKeyframeWindowMatchingAlgorithm< CAMERA_GEOMETRY_T >::numMatches_ = 0
private

The number of matches.

template<class CAMERA_GEOMETRY_T >
size_t okvis::VioKeyframeWindowMatchingAlgorithm< CAMERA_GEOMETRY_T >::numUncertainMatches_ = 0
private

The number of uncertain matches.

template<class CAMERA_GEOMETRY_T >
Eigen::Vector3d okvis::VioKeyframeWindowMatchingAlgorithm< CAMERA_GEOMETRY_T >::pA_W_
private

Camera center of frame A.

template<class CAMERA_GEOMETRY_T >
Eigen::Vector3d okvis::VioKeyframeWindowMatchingAlgorithm< CAMERA_GEOMETRY_T >::pB_W_
private

Camera center of frame B.

template<class CAMERA_GEOMETRY_T >
okvis::triangulation::ProbabilisticStereoTriangulator<camera_geometry_t> okvis::VioKeyframeWindowMatchingAlgorithm< CAMERA_GEOMETRY_T >::probabilisticStereoTriangulator_
private

Stereo triangulator.

template<class CAMERA_GEOMETRY_T >
Eigen::Matrix<double, Eigen::Dynamic, 2> okvis::VioKeyframeWindowMatchingAlgorithm< CAMERA_GEOMETRY_T >::projectionsIntoB_
private

temporarily store all projections

template<class CAMERA_GEOMETRY_T >
Eigen::Matrix<double, Eigen::Dynamic, 2> okvis::VioKeyframeWindowMatchingAlgorithm< CAMERA_GEOMETRY_T >::projectionsIntoBUncertainties_
private

temporarily store all projection uncertainties

template<class CAMERA_GEOMETRY_T >
std::vector<double> okvis::VioKeyframeWindowMatchingAlgorithm< CAMERA_GEOMETRY_T >::raySigmasA_
private

Temporarily store ray sigmas of frame A.

template<class CAMERA_GEOMETRY_T >
std::vector<double> okvis::VioKeyframeWindowMatchingAlgorithm< CAMERA_GEOMETRY_T >::raySigmasB_
private

Temporarily store ray sigmas of frame B.

template<class CAMERA_GEOMETRY_T >
std::vector<bool> okvis::VioKeyframeWindowMatchingAlgorithm< CAMERA_GEOMETRY_T >::skipA_
private

Should keypoint[index] in frame A be skipped.

template<class CAMERA_GEOMETRY_T >
std::vector<bool> okvis::VioKeyframeWindowMatchingAlgorithm< CAMERA_GEOMETRY_T >::skipB_
private

Should keypoint[index] in frame B be skipped.

template<class CAMERA_GEOMETRY_T >
okvis::kinematics::Transformation okvis::VioKeyframeWindowMatchingAlgorithm< CAMERA_GEOMETRY_T >::T_CaCb_
private
template<class CAMERA_GEOMETRY_T >
okvis::kinematics::Transformation okvis::VioKeyframeWindowMatchingAlgorithm< CAMERA_GEOMETRY_T >::T_CaW_
private
template<class CAMERA_GEOMETRY_T >
okvis::kinematics::Transformation okvis::VioKeyframeWindowMatchingAlgorithm< CAMERA_GEOMETRY_T >::T_CbCa_
private
template<class CAMERA_GEOMETRY_T >
okvis::kinematics::Transformation okvis::VioKeyframeWindowMatchingAlgorithm< CAMERA_GEOMETRY_T >::T_CbW_
private
template<class CAMERA_GEOMETRY_T >
okvis::kinematics::Transformation okvis::VioKeyframeWindowMatchingAlgorithm< CAMERA_GEOMETRY_T >::T_SaCa_
private
template<class CAMERA_GEOMETRY_T >
okvis::kinematics::Transformation okvis::VioKeyframeWindowMatchingAlgorithm< CAMERA_GEOMETRY_T >::T_SaW_
private
template<class CAMERA_GEOMETRY_T >
okvis::kinematics::Transformation okvis::VioKeyframeWindowMatchingAlgorithm< CAMERA_GEOMETRY_T >::T_SbCb_
private
template<class CAMERA_GEOMETRY_T >
okvis::kinematics::Transformation okvis::VioKeyframeWindowMatchingAlgorithm< CAMERA_GEOMETRY_T >::T_SbW_
private
template<class CAMERA_GEOMETRY_T >
okvis::kinematics::Transformation okvis::VioKeyframeWindowMatchingAlgorithm< CAMERA_GEOMETRY_T >::T_WCa_
private
template<class CAMERA_GEOMETRY_T >
okvis::kinematics::Transformation okvis::VioKeyframeWindowMatchingAlgorithm< CAMERA_GEOMETRY_T >::T_WCb_
private
template<class CAMERA_GEOMETRY_T >
okvis::kinematics::Transformation okvis::VioKeyframeWindowMatchingAlgorithm< CAMERA_GEOMETRY_T >::T_WSa_
private
template<class CAMERA_GEOMETRY_T >
okvis::kinematics::Transformation okvis::VioKeyframeWindowMatchingAlgorithm< CAMERA_GEOMETRY_T >::T_WSb_
private
template<class CAMERA_GEOMETRY_T >
bool okvis::VioKeyframeWindowMatchingAlgorithm< CAMERA_GEOMETRY_T >::usePoseUncertainty_ = false
private
template<class CAMERA_GEOMETRY_T >
bool okvis::VioKeyframeWindowMatchingAlgorithm< CAMERA_GEOMETRY_T >::validRelativeUncertainty_ = false
private

The documentation for this class was generated from the following files: