ivipsourcecode / dxslam

Other
415 stars 75 forks source link

This may be a BUG in /src/Matcher.cc #27

Open 2hanhan opened 2 years ago

2hanhan commented 2 years ago

I think this may be a bug in the program src/Matcher.cc on lines 68 to 75.The original code is as follows:

        // The size of the window will depend on the viewing direction
        float r = RadiusByViewingCos(pMP->mTrackViewCos);

        if(bFactor)
            r*=th;

        const std::vector<size_t> vIndices =
                F.GetFeaturesInArea(pMP->mTrackProjX,pMP->mTrackProjY,1,nPredictedLevel-1,nPredictedLevel);

The program comment is described as "The size of the window will depend on the viewing direction",but here the size is fixed to 1 pixel. It's strange. After testing, I found that setting the size to 1.2*r makes the tracking more robust. The modified code is as follows:

        // The size of the window will depend on the viewing direction
        float r = RadiusByViewingCos(pMP->mTrackViewCos);

        if(bFactor)
            r*=th;

        const std::vector<size_t> vIndices =
                F.GetFeaturesInArea(pMP->mTrackProjX,pMP->mTrackProjY,1.2*r,nPredictedLevel-1,nPredictedLevel);