SLProject 4.0.000
WAIKeyFrame Class Reference

AR Keyframe node class. More...

#include <WAIKeyFrame.h>

Public Member Functions

 WAIKeyFrame (const cv::Mat &Tcw, unsigned long id, bool fixKF, float fx, float fy, float cx, float cy, size_t N, const std::vector< cv::KeyPoint > &vKeysUn, const cv::Mat &descriptors, WAIOrbVocabulary *vocabulary, int nScaleLevels, float fScaleFactor, const std::vector< float > &vScaleFactors, const std::vector< float > &vLevelSigma2, const std::vector< float > &vInvLevelSigma2, int nMinX, int nMinY, int nMaxX, int nMaxY, const cv::Mat &KB)
 keyframe generation during map loading More...
 
 WAIKeyFrame (WAIFrame &F, bool retainImg=true)
 keyframe generation from frame More...
 
void SetPose (const cv::Mat &Tcw)
 
cv::Mat GetPose ()
 
cv::Mat GetPoseInverse ()
 
cv::Mat GetCameraCenter ()
 
cv::Mat GetRotation ()
 
cv::Mat GetTranslation ()
 
void ComputeBoW (WAIOrbVocabulary *vocabulary)
 
void SetBowVector (WAIBowVector &bow)
 
void AddConnection (WAIKeyFrame *pKF, int weight)
 
void EraseConnection (WAIKeyFrame *pKF)
 
void FindAndUpdateConnections (bool buildSpanningTree=true)
 
void UpdateConnections (std::map< WAIKeyFrame *, int > KFcounter, bool buildSpanningTree)
 
void UpdateBestCovisibles ()
 
std::set< WAIKeyFrame * > GetConnectedKeyFrames ()
 
std::vector< WAIKeyFrame * > GetVectorCovisibleKeyFrames ()
 
std::vector< WAIKeyFrame * > GetBestCovisibilityKeyFrames (const int &N)
 
std::vector< WAIKeyFrame * > GetCovisiblesByWeight (const int &w)
 
int GetWeight (WAIKeyFrame *pKF)
 
const std::map< WAIKeyFrame *, int > & GetConnectedKfWeights ()
 
void AddChild (WAIKeyFrame *pKF)
 
void EraseChild (WAIKeyFrame *pKF)
 
void ChangeParent (WAIKeyFrame *pKF)
 
std::set< WAIKeyFrame * > GetChilds ()
 
WAIKeyFrameGetParent ()
 
bool hasChild (WAIKeyFrame *pKF)
 
void AddLoopEdge (WAIKeyFrame *pKF)
 
std::set< WAIKeyFrame * > GetLoopEdges ()
 
void AddMapPoint (WAIMapPoint *pMP, size_t idx)
 
void EraseMapPointMatch (WAIMapPoint *pMP)
 
void EraseMapPointMatch (const size_t &idx)
 
void ReplaceMapPointMatch (const size_t &idx, WAIMapPoint *pMP)
 
std::set< WAIMapPoint * > GetMapPoints ()
 
std::vector< WAIMapPoint * > GetMapPointMatches ()
 
int TrackedMapPoints (const int &minObs)
 
WAIMapPointGetMapPoint (const size_t &idx)
 
bool hasMapPoint (WAIMapPoint *mp)
 
bool isFixed () const
 
std::vector< size_t > GetFeaturesInArea (const float &x, const float &y, const float &r) const
 
bool IsInImage (const float &x, const float &y) const
 
void SetNotErase ()
 
void SetErase ()
 
void SetBadFlag ()
 
bool isBad ()
 
bool findChildRecursive (WAIKeyFrame *kf)
 
float ComputeSceneMedianDepth (const int q)
 
size_t getSizeOfCvMat (const cv::Mat &mat)
 
size_t getSizeOf ()
 
void setTexturePath (const std::string &path)
 
const std::string & getTexturePath ()
 
cv::Mat getObjectMatrix ()
 get visual representation as SLPoints More...
 

Static Public Member Functions

static bool weightComp (int a, int b)
 
static bool lId (WAIKeyFrame *pKF1, WAIKeyFrame *pKF2)
 

Public Attributes

long unsigned int mnId
 
const long unsigned int mnFrameId
 
const double mTimeStamp
 
const bool _fixed = false
 
const int mnGridCols
 
const int mnGridRows
 
const float mfGridElementWidthInv
 
const float mfGridElementHeightInv
 
long unsigned int mnMarker [7]
 
long unsigned int mnLoopQuery = 0
 
int mnLoopWords = 0
 
float mLoopScore = -1.0
 
long unsigned int mnRelocQuery = 0
 
int mnRelocWords = 0
 
float mRelocScore = -1.0f
 
cv::Mat mTcwGBA
 
cv::Mat mTcwRefGBA
 
const float fx
 
const float fy
 
const float cx
 
const float cy
 
const float invfx
 
const float invfy
 
const int N = 0
 
const std::vector< cv::KeyPoint > mvKeysUn
 
const cv::Mat mDescriptors
 
WAIBowVector mBowVec
 
WAIFeatVector mFeatVec
 
cv::Mat mTcp
 
const int mnScaleLevels
 
const float mfScaleFactor
 
const float mfLogScaleFactor
 
const std::vector< float > mvScaleFactors
 
const std::vector< float > mvLevelSigma2
 
const std::vector< float > mvInvLevelSigma2
 
const int mnMinX
 
const int mnMinY
 
const int mnMaxX
 
const int mnMaxY
 
const cv::Mat mK
 
cv::Mat imgGray
 
std::mutex mMutexPose
 
std::mutex mMutexConnections
 
std::mutex mMutexFeatures
 

Static Public Attributes

static long unsigned int nNextId = 0
 

Protected Attributes

cv::Mat _Twc
 
cv::Mat _Tcw
 
cv::Mat Ow
 camera center More...
 
std::vector< WAIMapPoint * > mvpMapPoints
 
std::vector< std::size_t > mGrid [FRAME_GRID_COLS][FRAME_GRID_ROWS]
 
std::map< WAIKeyFrame *, int > mConnectedKeyFrameWeights
 
std::vector< WAIKeyFrame * > mvpOrderedConnectedKeyFrames
 
std::vector< int > mvOrderedWeights
 
bool mbFirstConnection = true
 
WAIKeyFramempParent = NULL
 
std::set< WAIKeyFrame * > mspChildrens
 
std::set< WAIKeyFrame * > mspLoopEdges
 
bool mbNotErase
 
bool mbToBeErased
 
bool mbBad
 

Private Member Functions

void AssignFeaturesToGrid ()
 this is a function from Frame, but we need it here for map loading More...
 
bool PosInGrid (const cv::KeyPoint &kp, int &posX, int &posY)
 this is a function from Frame, but we need it here for map loading More...
 

Private Attributes

std::string _pathToTexture
 

Detailed Description

AR Keyframe node class.

A Keyframe is a camera with a position and additional information about key- points that were found in this frame. It also contains descriptors for the found keypoints.

Constructor & Destructor Documentation

◆ WAIKeyFrame() [1/2]

WAIKeyFrame::WAIKeyFrame ( const cv::Mat &  Tcw,
unsigned long  id,
bool  fixKF,
float  fx,
float  fy,
float  cx,
float  cy,
size_t  N,
const std::vector< cv::KeyPoint > &  vKeysUn,
const cv::Mat &  descriptors,
WAIOrbVocabulary vocabulary,
int  nScaleLevels,
float  fScaleFactor,
const std::vector< float > &  vScaleFactors,
const std::vector< float > &  vLevelSigma2,
const std::vector< float > &  vInvLevelSigma2,
int  nMinX,
int  nMinY,
int  nMaxX,
int  nMaxY,
const cv::Mat &  KB 
)

keyframe generation during map loading

load an existing keyframe (used during file load)

◆ WAIKeyFrame() [2/2]

WAIKeyFrame::WAIKeyFrame ( WAIFrame F,
bool  retainImg = true 
)

keyframe generation from frame

Member Function Documentation

◆ AddChild()

void WAIKeyFrame::AddChild ( WAIKeyFrame pKF)

◆ AddConnection()

void WAIKeyFrame::AddConnection ( WAIKeyFrame pKF,
int  weight 
)

◆ AddLoopEdge()

void WAIKeyFrame::AddLoopEdge ( WAIKeyFrame pKF)

◆ AddMapPoint()

void WAIKeyFrame::AddMapPoint ( WAIMapPoint pMP,
size_t  idx 
)

◆ AssignFeaturesToGrid()

void WAIKeyFrame::AssignFeaturesToGrid ( )
private

this is a function from Frame, but we need it here for map loading

◆ ChangeParent()

void WAIKeyFrame::ChangeParent ( WAIKeyFrame pKF)

◆ ComputeBoW()

void WAIKeyFrame::ComputeBoW ( WAIOrbVocabulary vocabulary)

◆ ComputeSceneMedianDepth()

float WAIKeyFrame::ComputeSceneMedianDepth ( const int  q)

◆ EraseChild()

void WAIKeyFrame::EraseChild ( WAIKeyFrame pKF)

◆ EraseConnection()

void WAIKeyFrame::EraseConnection ( WAIKeyFrame pKF)

◆ EraseMapPointMatch() [1/2]

void WAIKeyFrame::EraseMapPointMatch ( const size_t &  idx)

◆ EraseMapPointMatch() [2/2]

void WAIKeyFrame::EraseMapPointMatch ( WAIMapPoint pMP)

◆ FindAndUpdateConnections()

void WAIKeyFrame::FindAndUpdateConnections ( bool  buildSpanningTree = true)

◆ findChildRecursive()

bool WAIKeyFrame::findChildRecursive ( WAIKeyFrame kf)

◆ GetBestCovisibilityKeyFrames()

vector< WAIKeyFrame * > WAIKeyFrame::GetBestCovisibilityKeyFrames ( const int &  N)

◆ GetCameraCenter()

cv::Mat WAIKeyFrame::GetCameraCenter ( )

◆ GetChilds()

std::set< WAIKeyFrame * > WAIKeyFrame::GetChilds ( )

◆ GetConnectedKeyFrames()

set< WAIKeyFrame * > WAIKeyFrame::GetConnectedKeyFrames ( )

◆ GetConnectedKfWeights()

const std::map< WAIKeyFrame *, int > & WAIKeyFrame::GetConnectedKfWeights ( )

◆ GetCovisiblesByWeight()

vector< WAIKeyFrame * > WAIKeyFrame::GetCovisiblesByWeight ( const int &  w)

◆ GetFeaturesInArea()

vector< size_t > WAIKeyFrame::GetFeaturesInArea ( const float &  x,
const float &  y,
const float &  r 
) const

◆ GetLoopEdges()

set< WAIKeyFrame * > WAIKeyFrame::GetLoopEdges ( )

◆ GetMapPoint()

WAIMapPoint * WAIKeyFrame::GetMapPoint ( const size_t &  idx)

◆ GetMapPointMatches()

vector< WAIMapPoint * > WAIKeyFrame::GetMapPointMatches ( )

◆ GetMapPoints()

set< WAIMapPoint * > WAIKeyFrame::GetMapPoints ( )

◆ getObjectMatrix()

cv::Mat WAIKeyFrame::getObjectMatrix ( )

get visual representation as SLPoints

◆ GetParent()

WAIKeyFrame * WAIKeyFrame::GetParent ( )

◆ GetPose()

cv::Mat WAIKeyFrame::GetPose ( )

◆ GetPoseInverse()

cv::Mat WAIKeyFrame::GetPoseInverse ( )

◆ GetRotation()

cv::Mat WAIKeyFrame::GetRotation ( )

◆ getSizeOf()

size_t WAIKeyFrame::getSizeOf ( )

◆ getSizeOfCvMat()

size_t WAIKeyFrame::getSizeOfCvMat ( const cv::Mat &  mat)

◆ getTexturePath()

const std::string & WAIKeyFrame::getTexturePath ( )
inline

◆ GetTranslation()

cv::Mat WAIKeyFrame::GetTranslation ( )

◆ GetVectorCovisibleKeyFrames()

vector< WAIKeyFrame * > WAIKeyFrame::GetVectorCovisibleKeyFrames ( )

◆ GetWeight()

int WAIKeyFrame::GetWeight ( WAIKeyFrame pKF)

◆ hasChild()

bool WAIKeyFrame::hasChild ( WAIKeyFrame pKF)

◆ hasMapPoint()

bool WAIKeyFrame::hasMapPoint ( WAIMapPoint mp)

◆ isBad()

bool WAIKeyFrame::isBad ( )

◆ isFixed()

bool WAIKeyFrame::isFixed ( ) const

◆ IsInImage()

bool WAIKeyFrame::IsInImage ( const float &  x,
const float &  y 
) const

◆ lId()

static bool WAIKeyFrame::lId ( WAIKeyFrame pKF1,
WAIKeyFrame pKF2 
)
inlinestatic

◆ PosInGrid()

bool WAIKeyFrame::PosInGrid ( const cv::KeyPoint &  kp,
int &  posX,
int &  posY 
)
private

this is a function from Frame, but we need it here for map loading

◆ ReplaceMapPointMatch()

void WAIKeyFrame::ReplaceMapPointMatch ( const size_t &  idx,
WAIMapPoint pMP 
)

◆ SetBadFlag()

void WAIKeyFrame::SetBadFlag ( )

◆ SetBowVector()

void WAIKeyFrame::SetBowVector ( WAIBowVector bow)

◆ SetErase()

void WAIKeyFrame::SetErase ( )

◆ SetNotErase()

void WAIKeyFrame::SetNotErase ( )

◆ SetPose()

void WAIKeyFrame::SetPose ( const cv::Mat &  Tcw)

◆ setTexturePath()

void WAIKeyFrame::setTexturePath ( const std::string &  path)
inline

◆ TrackedMapPoints()

int WAIKeyFrame::TrackedMapPoints ( const int &  minObs)

◆ UpdateBestCovisibles()

void WAIKeyFrame::UpdateBestCovisibles ( )

◆ UpdateConnections()

void WAIKeyFrame::UpdateConnections ( std::map< WAIKeyFrame *, int >  KFcounter,
bool  buildSpanningTree 
)

◆ weightComp()

static bool WAIKeyFrame::weightComp ( int  a,
int  b 
)
inlinestatic

Member Data Documentation

◆ _fixed

const bool WAIKeyFrame::_fixed = false

◆ _pathToTexture

std::string WAIKeyFrame::_pathToTexture
private

◆ _Tcw

cv::Mat WAIKeyFrame::_Tcw
protected

◆ _Twc

cv::Mat WAIKeyFrame::_Twc
protected

opencv coordinate representation: z-axis points to principlal point, x-axis to the right and y-axis down Infos about the pose: https://github.com/raulmur/ORB_SLAM2/issues/249

◆ cx

const float WAIKeyFrame::cx

◆ cy

const float WAIKeyFrame::cy

◆ fx

const float WAIKeyFrame::fx

◆ fy

const float WAIKeyFrame::fy

◆ imgGray

cv::Mat WAIKeyFrame::imgGray

◆ invfx

const float WAIKeyFrame::invfx

◆ invfy

const float WAIKeyFrame::invfy

◆ mbBad

bool WAIKeyFrame::mbBad
protected

◆ mbFirstConnection

bool WAIKeyFrame::mbFirstConnection = true
protected

◆ mbNotErase

bool WAIKeyFrame::mbNotErase
protected

◆ mBowVec

WAIBowVector WAIKeyFrame::mBowVec

◆ mbToBeErased

bool WAIKeyFrame::mbToBeErased
protected

◆ mConnectedKeyFrameWeights

std::map<WAIKeyFrame*, int> WAIKeyFrame::mConnectedKeyFrameWeights
protected

◆ mDescriptors

const cv::Mat WAIKeyFrame::mDescriptors

◆ mFeatVec

WAIFeatVector WAIKeyFrame::mFeatVec

◆ mfGridElementHeightInv

const float WAIKeyFrame::mfGridElementHeightInv

◆ mfGridElementWidthInv

const float WAIKeyFrame::mfGridElementWidthInv

◆ mfLogScaleFactor

const float WAIKeyFrame::mfLogScaleFactor

◆ mfScaleFactor

const float WAIKeyFrame::mfScaleFactor

◆ mGrid

std::vector<std::size_t> WAIKeyFrame::mGrid[FRAME_GRID_COLS][FRAME_GRID_ROWS]
protected

◆ mK

const cv::Mat WAIKeyFrame::mK

◆ mLoopScore

float WAIKeyFrame::mLoopScore = -1.0

◆ mMutexConnections

std::mutex WAIKeyFrame::mMutexConnections

◆ mMutexFeatures

std::mutex WAIKeyFrame::mMutexFeatures

◆ mMutexPose

std::mutex WAIKeyFrame::mMutexPose

◆ mnFrameId

const long unsigned int WAIKeyFrame::mnFrameId

◆ mnGridCols

const int WAIKeyFrame::mnGridCols

◆ mnGridRows

const int WAIKeyFrame::mnGridRows

◆ mnId

long unsigned int WAIKeyFrame::mnId

◆ mnLoopQuery

long unsigned int WAIKeyFrame::mnLoopQuery = 0

◆ mnLoopWords

int WAIKeyFrame::mnLoopWords = 0

◆ mnMarker

long unsigned int WAIKeyFrame::mnMarker[7]

◆ mnMaxX

const int WAIKeyFrame::mnMaxX

◆ mnMaxY

const int WAIKeyFrame::mnMaxY

◆ mnMinX

const int WAIKeyFrame::mnMinX

◆ mnMinY

const int WAIKeyFrame::mnMinY

◆ mnRelocQuery

long unsigned int WAIKeyFrame::mnRelocQuery = 0

◆ mnRelocWords

int WAIKeyFrame::mnRelocWords = 0

◆ mnScaleLevels

const int WAIKeyFrame::mnScaleLevels

◆ mpParent

WAIKeyFrame* WAIKeyFrame::mpParent = NULL
protected

◆ mRelocScore

float WAIKeyFrame::mRelocScore = -1.0f

◆ mspChildrens

std::set<WAIKeyFrame*> WAIKeyFrame::mspChildrens
protected

◆ mspLoopEdges

std::set<WAIKeyFrame*> WAIKeyFrame::mspLoopEdges
protected

◆ mTcp

cv::Mat WAIKeyFrame::mTcp

◆ mTcwGBA

cv::Mat WAIKeyFrame::mTcwGBA

◆ mTcwRefGBA

cv::Mat WAIKeyFrame::mTcwRefGBA

◆ mTimeStamp

const double WAIKeyFrame::mTimeStamp

◆ mvInvLevelSigma2

const std::vector<float> WAIKeyFrame::mvInvLevelSigma2

◆ mvKeysUn

const std::vector<cv::KeyPoint> WAIKeyFrame::mvKeysUn

◆ mvLevelSigma2

const std::vector<float> WAIKeyFrame::mvLevelSigma2

◆ mvOrderedWeights

std::vector<int> WAIKeyFrame::mvOrderedWeights
protected

◆ mvpMapPoints

std::vector<WAIMapPoint*> WAIKeyFrame::mvpMapPoints
protected

◆ mvpOrderedConnectedKeyFrames

std::vector<WAIKeyFrame*> WAIKeyFrame::mvpOrderedConnectedKeyFrames
protected

◆ mvScaleFactors

const std::vector<float> WAIKeyFrame::mvScaleFactors

◆ N

const int WAIKeyFrame::N = 0

◆ nNextId

long unsigned int WAIKeyFrame::nNextId = 0
static

This file is part of ORB-SLAM2.

Copyright (C) 2014-2016 Ra�l Mur-Artal <raulmur at unizar dot es> (University of Zaragoza) For more information see https://github.com/raulmur/ORB_SLAM2

ORB-SLAM2 is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

ORB-SLAM2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with ORB-SLAM2. If not, see http://www.gnu.org/licenses/.

◆ Ow

cv::Mat WAIKeyFrame::Ow
protected

camera center


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