BertaBescos / DynaSLAM

DynaSLAM is a SLAM system robust in dynamic environments for monocular, stereo and RGB-D setups
https://bertabescos.github.io/DynaSLAM/
Other
829 stars 201 forks source link

Questions about function ExtractDynPoints() #56

Open KaninchenM opened 4 years ago

KaninchenM commented 4 years ago

Hi, sorry to bother you. I learned Semantic SLAM in recent months and now I'am doing some experiment basing on your code. After reading your paper and code, I have some confusions especially for the function Geometry::ExtractDynPoints(const vector<ORB_SLAM2::Frame> &vRefFrames,const ORB_SLAM2::Frame &currentFrame) (in Dynaslam/src/Geometry.cc).

  1. What's the meaning of variable vMPw

    cv::Mat vMPw = refFrame.mTcw.inv() * vMPRefFrame;
  2. What is the purpose of the judgment sentence

    const float d = refFrame.mImDepth.at<float>(v,u);
            if (d > 0 && d < 6){
                matRefFrame.at<float>(k,0) = refFrame.mvKeysUn[j].pt.x;
                matRefFrame.at<float>(k,1) = refFrame.mvKeysUn[j].pt.y;
                matRefFrame.at<float>(k,2) = 1.;
                matInvDepthRefFrame.at<float>(k,0) = 1./d;
                matDepthRefFrame.at<float>(k,0) = d;
                vLabels.at<float>(k,0) = i;
                k++;
            }

    why the d should (d > 0 && d < 6)?

    for (int i(0); i < matProjDepth.cols; i++)
        {
            if (matProjDepth.at<float>(0,i) < 7)
            {
                __matProjDepth.at<float>(0,h) = matProjDepth.at<float>(0,i);
    
                _vMPCurrentFrame.at<float>(0,h) = vMPCurrentFrame.at<float>(0,i);
                _vMPCurrentFrame.at<float>(1,h) = vMPCurrentFrame.at<float>(1,i);
                _vMPCurrentFrame.at<float>(2,h) = vMPCurrentFrame.at<float>(2,i);
                _vMPCurrentFrame.at<float>(3,h) = vMPCurrentFrame.at<float>(3,i);
    
                _vAllMatRefFrame.at<float>(h,0) = vAllMatRefFrame.at<float>(i,0);
                _vAllMatRefFrame.at<float>(h,1) = vAllMatRefFrame.at<float>(i,1);
                _vAllMatRefFrame.at<float>(h,2) = vAllMatRefFrame.at<float>(i,2);
    
                _vLabels.at<float>(h,0) = vLabels.at<float>(i,0);
    
                __vAllDepthRefFrame.at<float>(h,0) = vAllDepthRefFrame.at<float>(i,0);
    
                h++;
            }
        }

    and why matProjDepth.at<float>(0,i) < 7

  3. How to set the value of mDmax?

    cv::Mat u1((2*mDmax+1)*(2*mDmax+1),2,CV_32F);
        int m(0);
        for (int i(-mDmax); i <= mDmax; i++){
            for (int j(-mDmax); j <= mDmax; j++){
                u1.at<float>(m,0) = i;
                u1.at<float>(m,1) = j;
                m++;
            }
        }

    and what's the meaning of mDmax,such as in

    if (matDepthDifference.at<float>(i,0) > mDepthThreshold)
            {
                int xIni = (int)matCurrentFrame.at<float>(i,0) - mDmax;
                int yIni = (int)matCurrentFrame.at<float>(i,1) - mDmax;
                int xEnd = (int)matCurrentFrame.at<float>(i,0) + mDmax + 1;
                int yEnd = (int)matCurrentFrame.at<float>(i,1) + mDmax + 1;
               ......
           }
  4. How to set the threshold τz(in code, it's mDepthThreshold)? In paper, it's 0.4m and in code it's 0.6m image image

  5. What's the use of mVarThreshold? Why only if (_stddev*_stddev)< mVarThreshold , can the keypoint be dynPoint? image

  6. I've statistics the spent time of GeometricModelCorrection part. In different data sequences, time-consuming varies greatly. In fr3_walking_rpy, it needs about 0.2s/frame while in fr3_walking_xyz, it needs 0.45+s/frame. Could you please give me some suggestions about what factors affect the GeometricModelCorrection part's spending time?

KaninchenM commented 4 years ago

Hope to get your help. Thank you so much!

KaninchenM commented 4 years ago

Answer Q5: find the idea in paper image