| 368 | } |
| 369 | |
| 370 | void FrameDrawer::Update(Tracking *pTracker) |
| 371 | { |
| 372 | unique_lock<mutex> lock(mMutex); |
| 373 | pTracker->mImGray.copyTo(mIm); |
| 374 | mvCurrentKeys=pTracker->mCurrentFrame.mvKeys; |
| 375 | mThDepth = pTracker->mCurrentFrame.mThDepth; |
| 376 | mvCurrentDepth = pTracker->mCurrentFrame.mvDepth; |
| 377 | |
| 378 | if(both){ |
| 379 | mvCurrentKeysRight = pTracker->mCurrentFrame.mvKeysRight; |
| 380 | pTracker->mImRight.copyTo(mImRight); |
| 381 | N = mvCurrentKeys.size() + mvCurrentKeysRight.size(); |
| 382 | } |
| 383 | else{ |
| 384 | N = mvCurrentKeys.size(); |
| 385 | } |
| 386 | |
| 387 | mvbVO = vector<bool>(N,false); |
| 388 | mvbMap = vector<bool>(N,false); |
| 389 | mbOnlyTracking = pTracker->mbOnlyTracking; |
| 390 | |
| 391 | //Variables for the new visualization |
| 392 | mCurrentFrame = pTracker->mCurrentFrame; |
| 393 | mmProjectPoints = mCurrentFrame.mmProjectPoints; |
| 394 | mmMatchedInImage.clear(); |
| 395 | |
| 396 | mvpLocalMap = pTracker->GetLocalMapMPS(); |
| 397 | mvMatchedKeys.clear(); |
| 398 | mvMatchedKeys.reserve(N); |
| 399 | mvpMatchedMPs.clear(); |
| 400 | mvpMatchedMPs.reserve(N); |
| 401 | mvOutlierKeys.clear(); |
| 402 | mvOutlierKeys.reserve(N); |
| 403 | mvpOutlierMPs.clear(); |
| 404 | mvpOutlierMPs.reserve(N); |
| 405 | |
| 406 | if(pTracker->mLastProcessedState==Tracking::NOT_INITIALIZED) |
| 407 | { |
| 408 | mvIniKeys=pTracker->mInitialFrame.mvKeys; |
| 409 | mvIniMatches=pTracker->mvIniMatches; |
| 410 | } |
| 411 | else if(pTracker->mLastProcessedState==Tracking::OK) |
| 412 | { |
| 413 | for(int i=0;i<N;i++) |
| 414 | { |
| 415 | MapPoint* pMP = pTracker->mCurrentFrame.mvpMapPoints[i]; |
| 416 | if(pMP) |
| 417 | { |
| 418 | if(!pTracker->mCurrentFrame.mvbOutlier[i]) |
| 419 | { |
| 420 | if(pMP->Observations()>0) |
| 421 | mvbMap[i]=true; |
| 422 | else |
| 423 | mvbVO[i]=true; |
| 424 | |
| 425 | mmMatchedInImage[pMP->mnId] = mvCurrentKeys[i].pt; |
| 426 | } |
| 427 | else |
nothing calls this directly
no test coverage detected