33 mnFirstKFid(pRefKF->mnId), mnFirstFrame(pRefKF->mnFrameId), nObs(0), mnTrackReferenceForFrame(0),
34 mnLastFrameSeen(0), mnBALocalForKF(0), mnFuseCandidateForKF(0), mnLoopPointForKF(0), mnCorrectedByKF(0),
35 mnCorrectedReference(0), mnBAGlobalForKF(0), mpRefKF(pRefKF), mnVisible(1), mnFound(1), mbBad(false),
36 mpReplaced(static_cast<
MapPoint*>(NULL)), mfMinDistance(0), mfMaxDistance(0), mpMap(pMap)
57 cv::Mat PC = Pos - Ow;
58 const float dist = cv::norm(PC);
59 const int level = pFrame->
mvKeysUn[idxF].octave;
153 map<KeyFrame*,size_t> obs;
161 for(map<KeyFrame*,size_t>::iterator mit=obs.begin(), mend=obs.end(); mit!=mend; mit++)
179 if(pMP->
mnId==this->mnId)
182 int nvisible, nfound;
183 map<KeyFrame*,size_t> obs;
195 for(map<KeyFrame*,size_t>::iterator mit=obs.begin(), mend=obs.end(); mit!=mend; mit++)
245 vector<cv::Mat> vDescriptors;
247 map<KeyFrame*,size_t> observations;
256 if(observations.empty())
259 vDescriptors.reserve(observations.size());
261 for(map<KeyFrame*,size_t>::iterator mit=observations.begin(), mend=observations.end(); mit!=mend; mit++)
266 vDescriptors.push_back(pKF->
mDescriptors.row(mit->second));
269 if(vDescriptors.empty())
273 const size_t N = vDescriptors.size();
275 float Distances[N][N];
276 for(
size_t i=0;i<N;i++)
279 for(
size_t j=i+1;j<N;j++)
282 Distances[i][j]=distij;
283 Distances[j][i]=distij;
288 int BestMedian = INT_MAX;
290 for(
size_t i=0;i<N;i++)
292 vector<int> vDists(Distances[i],Distances[i]+N);
293 sort(vDists.begin(),vDists.end());
294 int median = vDists[0.5*(N-1)];
296 if(median<BestMedian)
332 map<KeyFrame*,size_t> observations;
345 if(observations.empty())
348 cv::Mat normal = cv::Mat::zeros(3,1,CV_32F);
350 for(map<KeyFrame*,size_t>::iterator mit=observations.begin(), mend=observations.end(); mit!=mend; mit++)
355 normal = normal + normali/cv::norm(normali);
360 const float dist = cv::norm(PC);
361 const int level = pRefKF->
mvKeysUn[observations[pRefKF]].octave;
426 template<
class Archive>
float GetMinDistanceInvariance()
void EraseMapPointMatch(const size_t &idx)
std::mutex mMutexPointCreation
long unsigned int mnBALocalForKF
const std::vector< cv::KeyPoint > mvKeysUn
long unsigned int mnBAGlobalForKF
cv::Mat GetCameraCenter()
void EraseMapPoint(MapPoint *pMP)
std::mutex mMutexFeatures
const std::vector< float > mvScaleFactors
long unsigned int mnLoopPointForKF
static long unsigned int nNextId
long unsigned int mnCorrectedByKF
void ReplaceMapPointMatch(const size_t &idx, MapPoint *pMP)
void IncreaseVisible(int n=1)
void AddObservation(KeyFrame *pKF, size_t idx)
void UpdateNormalAndDepth()
std::vector< cv::KeyPoint > mvKeysUn
cv::Mat GetCameraCenter()
static std::mutex mGlobalMutex
std::map< KeyFrame *, size_t > GetObservations()
void IncreaseFound(int n=1)
KeyFrame * GetReferenceKeyFrame()
void Replace(MapPoint *pMP)
std::map< KeyFrame *, size_t > mObservations
void SetWorldPos(const cv::Mat &Pos)
static int DescriptorDistance(const cv::Mat &a, const cv::Mat &b)
float GetMaxDistanceInvariance()
vector< float > mvScaleFactors
long unsigned int mnLastFrameSeen
const std::vector< float > mvuRight
int GetIndexInKeyFrame(KeyFrame *pKF)
void serialize(Archive &ar, const unsigned int version)
long unsigned int mnTrackReferenceForFrame
long unsigned int mnCorrectedReference
void ComputeDistinctiveDescriptors()
const cv::Mat mDescriptors
bool IsInKeyFrame(KeyFrame *pKF)
int PredictScale(const float ¤tDist, KeyFrame *pKF)
long unsigned int mnFuseCandidateForKF
const float mfLogScaleFactor
void EraseObservation(KeyFrame *pKF)