#include <WAIMapPoint.h>
Definition at line 39 of file WAIMapPoint.h.
◆ RefKfSource
Enumerator |
---|
RefKfSource_None | |
RefKfSource_Constructor | |
RefKfSource_EraseObservation | |
Definition at line 93 of file WAIMapPoint.h.
@ RefKfSource_Constructor
@ RefKfSource_EraseObservation
◆ WAIMapPoint() [1/2]
WAIMapPoint::WAIMapPoint |
( |
int |
id, |
|
|
const cv::Mat & |
Pos, |
|
|
bool |
fixMp |
|
) |
| |
constructor used during map loading
Definition at line 22 of file WAIMapPoint.cpp.
static long unsigned int nNextId
long unsigned int mnCorrectedReference
long unsigned int mnLastFrameSeen
void SetWorldPos(const cv::Mat &Pos)
long unsigned int mnCorrectedByKF
◆ WAIMapPoint() [2/2]
WAIMapPoint::WAIMapPoint |
( |
const cv::Mat & |
Pos, |
|
|
WAIKeyFrame * |
pRefKF |
|
) |
| |
Definition at line 56 of file WAIMapPoint.cpp.
static std::mutex mMutexMapPointCreation
◆ AddObservation()
Definition at line 157 of file WAIMapPoint.cpp.
std::mutex mMutexFeatures
std::map< WAIKeyFrame *, size_t > mObservations
◆ ComputeDistinctiveDescriptors()
void WAIMapPoint::ComputeDistinctiveDescriptors |
( |
| ) |
|
Definition at line 313 of file WAIMapPoint.cpp.
316 vector<cv::Mat> vDescriptors;
318 map<WAIKeyFrame*, size_t> observations;
327 if (observations.empty())
330 vDescriptors.reserve(observations.size());
332 for (map<WAIKeyFrame*, size_t>::iterator mit = observations.begin(), mend = observations.end(); mit != mend; mit++)
336 if (pKF && !pKF->
isBad())
337 vDescriptors.push_back(pKF->
mDescriptors.row((
int)mit->second));
340 if (vDescriptors.empty())
344 size_t N = vDescriptors.size();
346 float** Distances =
new float*[N];
347 for (
size_t i = 0; i < N; ++i)
348 Distances[i] =
new float[N];
350 for (
size_t i = 0; i < N; i++)
353 for (
size_t j = i + 1; j < N; j++)
355 int distij = ORBmatcher::DescriptorDistance(vDescriptors[i], vDescriptors[j]);
356 Distances[i][j] = (float)distij;
357 Distances[j][i] = (float)distij;
362 int BestMedian = INT_MAX;
364 for (
size_t i = 0; i < N; i++)
366 vector<int> vDists(Distances[i], Distances[i] + N);
367 sort(vDists.begin(), vDists.end());
368 int median = vDists[(uint64_t)(0.5f * (N - 1))];
370 if (median < BestMedian)
378 for (
size_t i = 0; i < N; ++i)
const cv::Mat mDescriptors
◆ EraseObservation()
◆ GetDescriptor()
cv::Mat WAIMapPoint::GetDescriptor |
( |
| ) |
|
◆ GetFoundRatio()
float WAIMapPoint::GetFoundRatio |
( |
| ) |
|
◆ GetIndexInKeyFrame()
int WAIMapPoint::GetIndexInKeyFrame |
( |
WAIKeyFrame * |
pKF | ) |
|
◆ GetMaxDistance()
float WAIMapPoint::GetMaxDistance |
( |
| ) |
|
◆ GetMaxDistanceInvariance()
float WAIMapPoint::GetMaxDistanceInvariance |
( |
| ) |
|
◆ GetMinDistance()
float WAIMapPoint::GetMinDistance |
( |
| ) |
|
◆ GetMinDistanceInvariance()
float WAIMapPoint::GetMinDistanceInvariance |
( |
| ) |
|
◆ GetNormal()
cv::Mat WAIMapPoint::GetNormal |
( |
| ) |
|
◆ GetObservations()
std::map< WAIKeyFrame *, size_t > WAIMapPoint::GetObservations |
( |
| ) |
|
◆ GetReferenceKeyFrame()
◆ GetReplaced()
◆ getSizeOf()
size_t WAIMapPoint::getSizeOf |
( |
| ) |
|
Definition at line 537 of file WAIMapPoint.cpp.
541 size +=
sizeof(*this);
size_t getSizeOfCvMat(const cv::Mat &mat)
◆ getSizeOfCvMat()
size_t WAIMapPoint::getSizeOfCvMat |
( |
const cv::Mat & |
mat | ) |
|
Definition at line 525 of file WAIMapPoint.cpp.
528 if (mat.isContinuous())
529 size = mat.total() * mat.elemSize();
532 size = mat.step[0] * mat.rows;
◆ GetWorldPos()
cv::Mat WAIMapPoint::GetWorldPos |
( |
| ) |
|
◆ IncreaseFound()
void WAIMapPoint::IncreaseFound |
( |
int |
n = 1 | ) |
|
◆ IncreaseVisible()
void WAIMapPoint::IncreaseVisible |
( |
int |
n = 1 | ) |
|
◆ isBad()
bool WAIMapPoint::isBad |
( |
| ) |
|
◆ isFixed()
bool WAIMapPoint::isFixed |
( |
| ) |
const |
|
inline |
◆ IsInKeyFrame()
◆ loadedFromMap()
bool WAIMapPoint::loadedFromMap |
( |
| ) |
|
|
inline |
◆ normalVec()
◆ Observations()
int WAIMapPoint::Observations |
( |
| ) |
|
◆ PredictScale() [1/2]
int WAIMapPoint::PredictScale |
( |
const float & |
currentDist, |
|
|
WAIFrame * |
pF |
|
) |
| |
Definition at line 508 of file WAIMapPoint.cpp.
void log(const char *tag, const char *format,...)
logs a formatted string platform independently
◆ PredictScale() [2/2]
int WAIMapPoint::PredictScale |
( |
const float & |
currentDist, |
|
|
WAIKeyFrame * |
pF |
|
) |
| |
Definition at line 491 of file WAIMapPoint.cpp.
499 int nScale = (int)
ceil(
log(ratio) / pKF->mfLogScaleFactor);
502 else if (nScale >= pKF->mnScaleLevels)
503 nScale = pKF->mnScaleLevels - 1;
◆ refKf() [1/2]
◆ refKf() [2/2]
◆ Replace()
Definition at line 250 of file WAIMapPoint.cpp.
252 if (pMP->
mnId == this->mnId)
255 int nvisible, nfound;
256 map<WAIKeyFrame*, size_t> obs;
268 for (map<WAIKeyFrame*, size_t>::iterator mit = obs.begin(), mend = obs.end(); mit != mend; mit++)
void EraseMapPointMatch(WAIMapPoint *pMP)
void ReplaceMapPointMatch(const size_t &idx, WAIMapPoint *pMP)
void AddObservation(WAIKeyFrame *pKF, size_t idx)
bool IsInKeyFrame(WAIKeyFrame *pKF)
void IncreaseVisible(int n=1)
void ComputeDistinctiveDescriptors()
void IncreaseFound(int n=1)
◆ SetBadFlag()
void WAIMapPoint::SetBadFlag |
( |
| ) |
|
Definition at line 226 of file WAIMapPoint.cpp.
228 map<WAIKeyFrame*, size_t> obs;
236 for (map<WAIKeyFrame*, size_t>::iterator mit = obs.begin(), mend = obs.end(); mit != mend; mit++)
◆ SetDescriptor()
void WAIMapPoint::SetDescriptor |
( |
const cv::Mat & |
descriptor | ) |
|
◆ SetMaxDistance()
void WAIMapPoint::SetMaxDistance |
( |
float |
maxDist | ) |
|
◆ SetMinDistance()
void WAIMapPoint::SetMinDistance |
( |
float |
minDist | ) |
|
◆ SetNormal()
void WAIMapPoint::SetNormal |
( |
const cv::Mat & |
normal | ) |
|
◆ SetWorldPos()
void WAIMapPoint::SetWorldPos |
( |
const cv::Mat & |
Pos | ) |
|
◆ UpdateNormalAndDepth()
void WAIMapPoint::UpdateNormalAndDepth |
( |
| ) |
|
Definition at line 416 of file WAIMapPoint.cpp.
418 map<WAIKeyFrame*, size_t> observations;
431 if (observations.empty())
434 cv::Mat normal = cv::Mat::zeros(3, 1, CV_32F);
436 for (map<WAIKeyFrame*, size_t>::iterator mit = observations.begin(), mend = observations.end(); mit != mend; mit++)
441 normal = normal + normali / cv::norm(normali);
446 const float dist = (float)cv::norm(PC);
447 const int level = pRefKF->
mvKeysUn[observations[pRefKF]].octave;
cv::Mat GetCameraCenter()
const std::vector< float > mvScaleFactors
const std::vector< cv::KeyPoint > mvKeysUn
◆ worldPosVec() [1/2]
WAI::V3 WAIMapPoint::worldPosVec |
( |
| ) |
|
◆ worldPosVec() [2/2]
◆ _fixed
bool WAIMapPoint::_fixed = false |
|
protected |
◆ _loadedFromMap
bool WAIMapPoint::_loadedFromMap = false |
|
protected |
◆ mbBad
bool WAIMapPoint::mbBad = false |
|
protected |
◆ mbTrackInView
bool WAIMapPoint::mbTrackInView = false |
◆ mDescriptor
cv::Mat WAIMapPoint::mDescriptor |
|
protected |
◆ mfMaxDistance
float WAIMapPoint::mfMaxDistance = 0.f |
|
protected |
◆ mfMinDistance
float WAIMapPoint::mfMinDistance = 0.f |
|
protected |
◆ mGlobalMutex
mutex WAIMapPoint::mGlobalMutex |
|
static |
◆ mMutexFeatures
std::mutex WAIMapPoint::mMutexFeatures |
|
protected |
◆ mMutexMapPointCreation
mutex WAIMapPoint::mMutexMapPointCreation |
|
static |
◆ mMutexPos
std::mutex WAIMapPoint::mMutexPos |
|
protected |
◆ mnCorrectedByKF
long unsigned int WAIMapPoint::mnCorrectedByKF |
◆ mnCorrectedReference
long unsigned int WAIMapPoint::mnCorrectedReference |
◆ mnFirstKFid
long int WAIMapPoint::mnFirstKFid |
◆ mnFound
int WAIMapPoint::mnFound = 0 |
|
protected |
◆ mnId
long unsigned int WAIMapPoint::mnId = -1 |
◆ mnLastFrameSeen
long unsigned int WAIMapPoint::mnLastFrameSeen = 0 |
◆ mnMarker
int WAIMapPoint::mnMarker[7] |
◆ mNormalVector
cv::Mat WAIMapPoint::mNormalVector |
|
protected |
◆ mnTrackScaleLevel
int WAIMapPoint::mnTrackScaleLevel = 0 |
◆ mnVisible
int WAIMapPoint::mnVisible = 0 |
|
protected |
◆ mObservations
std::map<WAIKeyFrame*, size_t> WAIMapPoint::mObservations |
|
protected |
◆ mPosGBA
cv::Mat WAIMapPoint::mPosGBA |
◆ mpRefKF
◆ mpReplaced
◆ mTrackProjX
float WAIMapPoint::mTrackProjX = 0.0f |
◆ mTrackProjY
float WAIMapPoint::mTrackProjY = 0.0f |
◆ mTrackViewCos
float WAIMapPoint::mTrackViewCos = 0.0f |
◆ mWorldPos
cv::Mat WAIMapPoint::mWorldPos |
|
protected |
◆ nNextId
long unsigned int WAIMapPoint::nNextId = 0 |
|
static |
◆ nObs
int WAIMapPoint::nObs = 0 |
◆ refKfSource
The documentation for this class was generated from the following files: