| 296 | } |
| 297 | |
| 298 | void 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 | |
| 340 | void LocalMapping::EmptyQueue() |
| 341 | { |
nothing calls this directly
no test coverage detected