MCPcopy Create free account
hub / github.com/UZ-SLAMLab/ORB_SLAM3 / ProcessNewKeyFrame

Method ProcessNewKeyFrame

src/LocalMapping.cc:298–338  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

296}
297
298void LocalMapping::ProcessNewKeyFrame()
299{
300 {
301 unique_lock<mutex> lock(mMutexNewKFs);
302 mpCurrentKeyFrame = mlNewKeyFrames.front();
303 mlNewKeyFrames.pop_front();
304 }
305
306 // Compute Bags of Words structures
307 mpCurrentKeyFrame->ComputeBoW();
308
309 // Associate MapPoints to the new keyframe and update normal and descriptor
310 const vector<MapPoint*> vpMapPointMatches = mpCurrentKeyFrame->GetMapPointMatches();
311
312 for(size_t i=0; i<vpMapPointMatches.size(); i++)
313 {
314 MapPoint* pMP = vpMapPointMatches[i];
315 if(pMP)
316 {
317 if(!pMP->isBad())
318 {
319 if(!pMP->IsInKeyFrame(mpCurrentKeyFrame))
320 {
321 pMP->AddObservation(mpCurrentKeyFrame, i);
322 pMP->UpdateNormalAndDepth();
323 pMP->ComputeDistinctiveDescriptors();
324 }
325 else // this can only happen for new stereo points inserted by the Tracking
326 {
327 mlpRecentAddedMapPoints.push_back(pMP);
328 }
329 }
330 }
331 }
332
333 // Update links in the Covisibility Graph
334 mpCurrentKeyFrame->UpdateConnections();
335
336 // Insert Keyframe in Map
337 mpAtlas->AddKeyFrame(mpCurrentKeyFrame);
338}
339
340void LocalMapping::EmptyQueue()
341{

Callers

nothing calls this directly

Calls 10

GetMapPointMatchesMethod · 0.80
IsInKeyFrameMethod · 0.80
AddObservationMethod · 0.80
UpdateNormalAndDepthMethod · 0.80
UpdateConnectionsMethod · 0.80
ComputeBoWMethod · 0.45
sizeMethod · 0.45
isBadMethod · 0.45
AddKeyFrameMethod · 0.45

Tested by

no test coverage detected