#include <WAIFrame.h>
|
| WAIFrame () |
|
| WAIFrame (const WAIFrame &frame) |
| copy constructor More...
|
|
| WAIFrame (const cv::Mat &imGray, const double &timeStamp, KPextractor *extractor, cv::Mat &K, cv::Mat &distCoef, WAIOrbVocabulary *vocabulary, bool retainImg=false) |
| constructor used for detection in tracking More...
|
|
void | ExtractFeaturePoints (const cv::Mat &im) |
|
void | ComputeBoW () |
|
void | SetPose (cv::Mat Tcw) |
|
void | UpdatePoseMatrices () |
|
cv::Mat | GetCameraCenter () |
|
cv::Mat | GetRotationInverse () |
|
cv::Mat | GetTranslationCW () |
|
cv::Mat | GetRotationCW () |
|
bool | isInFrustum (WAIMapPoint *pMP, float viewingCosLimit) |
|
bool | PosInGrid (const cv::KeyPoint &kp, int &posX, int &posY) |
|
std::vector< size_t > | GetFeaturesInArea (const float &x, const float &y, const float &r, const int minLevel=-1, const int maxLevel=-1) const |
|
Definition at line 48 of file WAIFrame.h.
◆ WAIFrame() [1/3]
◆ WAIFrame() [2/3]
WAIFrame::WAIFrame |
( |
const WAIFrame & |
frame | ) |
|
copy constructor
Definition at line 58 of file WAIFrame.cpp.
86 if (!frame.
mTcw.empty())
std::vector< float > mvScaleFactors
std::vector< float > mvLevelSigma2
std::vector< WAIMapPoint * > mvpMapPoints
std::vector< float > mvInvScaleFactors
std::vector< cv::KeyPoint > mvKeys
std::vector< std::size_t > mGrid[64][36]
std::vector< float > mvInvLevelSigma2
WAIKeyFrame * mpReferenceKF
WAIOrbVocabulary * mVocabulary
KPextractor * mpORBextractorLeft
std::vector< cv::KeyPoint > mvKeysUn
void SetPose(cv::Mat Tcw)
◆ WAIFrame() [3/3]
WAIFrame::WAIFrame |
( |
const cv::Mat & |
imGray, |
|
|
const double & |
timeStamp, |
|
|
KPextractor * |
extractor, |
|
|
cv::Mat & |
K, |
|
|
cv::Mat & |
distCoef, |
|
|
WAIOrbVocabulary * |
vocabulary, |
|
|
bool |
retainImg = false |
|
) |
| |
constructor used for detection in tracking
Definition at line 93 of file WAIFrame.cpp.
99 K.convertTo(
mK, CV_32F);
137 fx =
mK.at<
float>(0, 0);
138 fy =
mK.at<
float>(1, 1);
139 cx =
mK.at<
float>(0, 2);
140 cy =
mK.at<
float>(1, 2);
#define AVERAGE_TIMING_STOP(name)
#define AVERAGE_TIMING_START(name)
static float mfGridElementHeightInv
void AssignFeaturesToGrid()
static long unsigned int nNextId
void ExtractFeaturePoints(const cv::Mat &im)
void UndistortKeyPoints()
static float mfGridElementWidthInv
void ComputeImageBounds(const cv::Mat &imLeft)
static bool mbInitialComputations
void log(const char *tag, const char *format,...)
logs a formatted string platform independently
◆ AssignFeaturesToGrid()
void WAIFrame::AssignFeaturesToGrid |
( |
| ) |
|
|
private |
Definition at line 156 of file WAIFrame.cpp.
161 mGrid[i][j].reserve(nReserve);
163 for (
int i = 0; i <
N; i++)
165 const cv::KeyPoint& kp =
mvKeysUn[i];
167 int nGridPosX, nGridPosY;
169 mGrid[nGridPosX][nGridPosY].push_back(i);
bool PosInGrid(const cv::KeyPoint &kp, int &posX, int &posY)
◆ ComputeBoW()
void WAIFrame::ComputeBoW |
( |
| ) |
|
Definition at line 317 of file WAIFrame.cpp.
void transform(const cv::Mat &descriptors, WAIBowVector &bow, WAIFeatVector &feat)
◆ ComputeImageBounds()
void WAIFrame::ComputeImageBounds |
( |
const cv::Mat & |
imLeft | ) |
|
|
private |
Definition at line 362 of file WAIFrame.cpp.
366 cv::Mat mat(4, 2, CV_32F);
367 mat.at<
float>(0, 0) = 0.0;
368 mat.at<
float>(0, 1) = 0.0;
369 mat.at<
float>(1, 0) = (
float)imLeft.cols;
370 mat.at<
float>(1, 1) = 0.0;
371 mat.at<
float>(2, 0) = 0.0;
372 mat.at<
float>(2, 1) = (
float)imLeft.rows;
373 mat.at<
float>(3, 0) = (
float)imLeft.cols;
374 mat.at<
float>(3, 1) = (
float)imLeft.rows;
377 mat = mat.reshape(2);
379 mat = mat.reshape(1);
381 mnMinX = (float)min(mat.at<
float>(0, 0), mat.at<
float>(2, 0));
382 mnMaxX = (float)max(mat.at<
float>(1, 0), mat.at<
float>(3, 0));
383 mnMinY = (float)min(mat.at<
float>(0, 1), mat.at<
float>(1, 1));
384 mnMaxY = (float)max(mat.at<
float>(2, 1), mat.at<
float>(3, 1));
389 mnMaxX = (float)imLeft.cols;
391 mnMaxY = (
float)imLeft.rows;
◆ ExtractFeaturePoints()
void WAIFrame::ExtractFeaturePoints |
( |
const cv::Mat & |
im | ) |
|
◆ GetCameraCenter()
cv::Mat WAIFrame::GetCameraCenter |
( |
| ) |
|
|
inline |
◆ GetFeaturesInArea()
vector< size_t > WAIFrame::GetFeaturesInArea |
( |
const float & |
x, |
|
|
const float & |
y, |
|
|
const float & |
r, |
|
|
const int |
minLevel = -1 , |
|
|
const int |
maxLevel = -1 |
|
) |
| const |
Definition at line 250 of file WAIFrame.cpp.
252 vector<size_t> vIndices;
271 const bool bCheckLevels = (minLevel > 0) || (maxLevel >= 0);
273 for (
int ix = nMinCellX; ix <= nMaxCellX; ix++)
275 for (
int iy = nMinCellY; iy <= nMaxCellY; iy++)
277 const vector<size_t> vCell =
mGrid[ix][iy];
281 for (
size_t j = 0, jend = vCell.size(); j < jend; j++)
283 const cv::KeyPoint& kpUn =
mvKeysUn[vCell[j]];
286 if (kpUn.octave < minLevel)
289 if (kpUn.octave > maxLevel)
293 const float distx = kpUn.pt.x - x;
294 const float disty = kpUn.pt.y - y;
296 if (fabs(distx) < r && fabs(disty) < r)
297 vIndices.push_back(vCell[j]);
◆ GetRotationCW()
cv::Mat WAIFrame::GetRotationCW |
( |
| ) |
|
|
inline |
◆ GetRotationInverse()
cv::Mat WAIFrame::GetRotationInverse |
( |
| ) |
|
|
inline |
◆ GetTranslationCW()
cv::Mat WAIFrame::GetTranslationCW |
( |
| ) |
|
|
inline |
◆ isInFrustum()
bool WAIFrame::isInFrustum |
( |
WAIMapPoint * |
pMP, |
|
|
float |
viewingCosLimit |
|
) |
| |
Definition at line 192 of file WAIFrame.cpp.
201 const float& PcX = Pc.at<
float>(0);
202 const float& PcY = Pc.at<
float>(1);
203 const float& PcZ = Pc.at<
float>(2);
210 const float invz = 1.0f / PcZ;
211 const float u =
fx * PcX * invz +
cx;
212 const float v =
fy * PcY * invz +
cy;
214 if (u < mnMinX || u >
mnMaxX)
216 if (v < mnMinY || v >
mnMaxY)
222 const cv::Mat PO = P -
mOw;
223 const float dist = (float)cv::norm(PO);
225 if (dist < minDistance || dist > maxDistance)
231 const float viewCos = (float)(PO.dot(Pn) / dist);
233 if (viewCos < viewingCosLimit)
237 const int nPredictedLevel = pMP->
PredictScale(dist,
this);
float GetMaxDistanceInvariance()
int PredictScale(const float ¤tDist, WAIKeyFrame *pF)
float GetMinDistanceInvariance()
◆ PosInGrid()
bool WAIFrame::PosInGrid |
( |
const cv::KeyPoint & |
kp, |
|
|
int & |
posX, |
|
|
int & |
posY |
|
) |
| |
◆ SetPose()
void WAIFrame::SetPose |
( |
cv::Mat |
Tcw | ) |
|
◆ UndistortKeyPoints()
void WAIFrame::UndistortKeyPoints |
( |
| ) |
|
|
private |
Definition at line 330 of file WAIFrame.cpp.
339 cv::Mat mat(
N, 2, CV_32F);
340 for (
int i = 0; i <
N; i++)
342 mat.at<
float>(i, 0) =
mvKeys[i].pt.x;
343 mat.at<
float>(i, 1) =
mvKeys[i].pt.y;
347 mat = mat.reshape(2);
349 mat = mat.reshape(1);
353 for (
int i = 0; i <
N; i++)
355 cv::KeyPoint kp =
mvKeys[i];
356 kp.pt.x = mat.at<
float>(i, 0);
357 kp.pt.y = mat.at<
float>(i, 1);
◆ UpdatePoseMatrices()
void WAIFrame::UpdatePoseMatrices |
( |
| ) |
|
◆ cx
float WAIFrame::cx = 0.0f |
|
static |
◆ cy
float WAIFrame::cy = 0.0f |
|
static |
◆ fx
float WAIFrame::fx = 0.0f |
|
static |
◆ fy
float WAIFrame::fy = 0.0f |
|
static |
◆ imgGray
cv::Mat WAIFrame::imgGray |
◆ invfx
float WAIFrame::invfx = 0.0f |
|
static |
◆ invfy
float WAIFrame::invfy = 0.0f |
|
static |
◆ mbInitialComputations
bool WAIFrame::mbInitialComputations = true |
|
static |
◆ mBowVec
◆ mDescriptors
cv::Mat WAIFrame::mDescriptors |
◆ mDistCoef
cv::Mat WAIFrame::mDistCoef |
◆ mFeatVec
◆ mfGridElementHeightInv
float WAIFrame::mfGridElementHeightInv = 0.0f |
|
static |
◆ mfGridElementWidthInv
float WAIFrame::mfGridElementWidthInv = 0.0f |
|
static |
◆ mfLogScaleFactor
float WAIFrame::mfLogScaleFactor |
◆ mfScaleFactor
float WAIFrame::mfScaleFactor |
◆ mGrid
std::vector<std::size_t> WAIFrame::mGrid[64][36] |
◆ mK
◆ mnId
long unsigned int WAIFrame::mnId = -1 |
◆ mnMaxX
float WAIFrame::mnMaxX = 0.0f |
|
static |
◆ mnMaxY
float WAIFrame::mnMaxY = 0.0f |
|
static |
◆ mnMinX
float WAIFrame::mnMinX = 0.0f |
|
static |
◆ mnMinY
float WAIFrame::mnMinY = 0.0f |
|
static |
◆ mnScaleLevels
int WAIFrame::mnScaleLevels |
◆ mOw
◆ mpORBextractorLeft
KPextractor* WAIFrame::mpORBextractorLeft = NULL |
◆ mpReferenceKF
◆ mRcw
◆ mRwc
◆ mTcw
◆ mtcw
◆ mTimeStamp
double WAIFrame::mTimeStamp |
◆ mvDepth
std::vector<float> WAIFrame::mvDepth |
◆ mvInvLevelSigma2
std::vector<float> WAIFrame::mvInvLevelSigma2 |
◆ mvInvScaleFactors
std::vector<float> WAIFrame::mvInvScaleFactors |
◆ mvKeys
std::vector<cv::KeyPoint> WAIFrame::mvKeys |
◆ mvKeysUn
std::vector<cv::KeyPoint> WAIFrame::mvKeysUn |
◆ mvLevelSigma2
std::vector<float> WAIFrame::mvLevelSigma2 |
◆ mVocabulary
◆ mvpMapPoints
◆ mvScaleFactors
std::vector<float> WAIFrame::mvScaleFactors |
◆ mvuRight
std::vector<float> WAIFrame::mvuRight |
◆ nNextId
long unsigned int WAIFrame::nNextId = 0 |
|
static |
The documentation for this class was generated from the following files: