Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

usage of viewMP and mNormalVector should not be based on the camera frame #32

Open
cy-goh opened this issue Sep 3, 2020 · 0 comments
Open
Assignees

Comments

@cy-goh
Copy link

cy-goh commented Sep 3, 2020

Hi

I am trying to understand the usage of the mViewMPs variable inside KeyFrame.h. As I understand it, 1 of the main purpose of mViewMps is to average the normal viewing vector inside the MapPoint variable. This is how you compute inside LocalMapper.cpp.

            Point3f x3d =
            cvu::triangulate(pMP->getMainMeasure(), mNewKF->keyPointsUn[i].pt,
                             Config::Kcam*pMP->mMainKF->Tcw.rowRange(0,3),
                             Config::Kcam*mNewKF->Tcw.rowRange(0,3));
            Point3f posNewKF = cvu::se3map(mNewKF->Tcw, x3d);
            if(pMP->acceptNewObserve(posNewKF, mNewKF->keyPoints[i])){
                continue;
            }
            if(posNewKF.z > Config::UPPER_DEPTH || posNewKF.z < Config::LOWER_DEPTH)
                continue;
            Eigen::Matrix3d infoNew, infoOld;
            Track::calcSE3toXYZInfo(posNewKF, mNewKF->Tcw, pMP->mMainKF->Tcw, infoNew, infoOld);
            mNewKF->setViewMP(posNewKF, i, infoNew);

When you set posNewKF based on cvu::se3map(mNewKF->Tcw, x3d), i think it means that the normal viewing vector is calculated from the angle between the keypoint and local camera center. This means that pMP->acceptNewObserve will pass as long as the map point is positioned around the same keypoint location inside the keyframe. If a map point is created from 2 keyframes of heading ~0degrees, acceptNewObserve will pass even from a keyframe of heading 180degrees, as long as it is around the same keypoint location in the image.

In ORB-SLAM2, the normal vector is calculated globally.

I like to check if this is bug, or if I misunderstood something. I will see if I can provide a pull request if it is a bug.

@cy-goh cy-goh changed the title usage of viewMP and mNormalVector usage of viewMP and mNormalVector should not be set locally Sep 3, 2020
@cy-goh cy-goh changed the title usage of viewMP and mNormalVector should not be set locally usage of viewMP and mNormalVector should not be based on the camera frame Sep 3, 2020
@izhengfan izhengfan self-assigned this Sep 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants