helperTrackLocalMap error with Monocular SLAM

Hi everyone,
I have run the Monocular SLAM (https://www.mathworks.com/help/vision/examples/monocular-visual-simultaneous-localization-and-mapping.html.) with Matlab 2020a, and I have tried some datasets, e.g., the TUM dataset in the tutorial and the Kitti dataset. How, I have got the following error.
Error using worldToImage
Expected worldPoints to be nonempty.
Error in worldToImage (line 83)
validateattributes(worldPoints, {'double', 'single'}, ...
Error in helperTrackLocalMap (line 63)
projectedPoints = worldToImage(intrinsics, R, t, localMapPoints);
Error in main (line 218)
helperTrackLocalMap(mapPointSet, vSetKeyFrames, mapPointsIdx, ...
I have found that this error is due to few keypoints. I did not change anything of the tutorial except changing the name of the helper function helperSURFFeatureExtractorFunction to helperExtractorFunction (helperExtractorFunction ). I was wondering if anyone else can run the tutorial successfully. Any help would be appreciated.

6 件のコメント

Qu Cao
Qu Cao 2020 年 5 月 15 日
The error indicates that not enough features can be tracked in the current frame.
Could you attach an image of the point cloud? It will help to understand if the tracking failure occurs even before this frame.
Sashamaru John
Sashamaru John 2020 年 5 月 16 日
I think the tracking is success for previous frames, but there are no inliers for current frame (1051).
Qu Cao
Qu Cao 2020 年 5 月 18 日
I agree with your that the tracking for previous frames are succsessful.
Please try tunning the parameters to see if it helps improve the robustness:
  • In helperIsKeyFrame, set the minimum number of tracked map points to a larger value, say 90;
  • In helperCreateNewMapPoints, change 'MaxRatio' to a smaller value, say 0.7.
Sashamaru John
Sashamaru John 2020 年 5 月 20 日
Thanks, it works.
Qu Cao
Qu Cao 2020 年 5 月 20 日
Sashamaru, great to hear that tuning the parameter works!
Could you let me know which parameter of the two you changed?
Sashamaru John
Sashamaru John 2020 年 5 月 21 日
Both work for me. Changing the first seems to be better than the second.

サインインしてコメントする。

回答 (1 件)

Qu Cao
Qu Cao 2020 年 8 月 19 日

0 投票

Answer pasted from comments:
Please try tunning the parameters to see if it helps improve the robustness:
  • In helperIsKeyFrame, set the minimum number of tracked map points to a larger value, say 90;
  • In helperCreateNewMapPoints, change 'MaxRatio' to a smaller value, say 0.7

2 件のコメント

jose daniel hoyos giraldo
jose daniel hoyos giraldo 2021 年 12 月 27 日
hello. Can you give me a hand improving the robustness, because I'm using a low resolution camera. Do you suggest change the line (in helperIsKeyFrame):
tooFewMapPoints = numel(mapPointsIndices) < 100;
for
tooFewMapPoints = numel(mapPointsIndices) < 500;
and the line:
tooFewTrackedPoints = numel(mapPointsIndices) < 0.9 * numPointsRefKeyFrame;
for
tooFewTrackedPoints = numel(mapPointsIndices) < 0.95 * numPointsRefKeyFrame;
Or similar?
On the other hand, in helperCreateNewMapPoints, u suggest use a smaller value of 'MaxRatio', but at mathworks it says "Use the max ratio for rejecting ambiguous matches. Increase this value to return more matches." (https://la.mathworks.com/help/vision/ref/matchfeatures.html).Then, if we have poor image quality and issues with a low number of points, why do you suggest decrease this value?.
Thanks for your help!
xingxingcui
xingxingcui 2022 年 11 月 29 日
編集済み: xingxingcui 2022 年 11 月 29 日
I think this is more of an empirical threshold that is dynamically adjusted to your own images @jose daniel hoyos giraldo ,You can refer to the thresholds designed in the latest version of R2022b for the exact TUM dataset

サインインしてコメントする。

カテゴリ

製品

リリース

R2020a

質問済み:

2020 年 5 月 15 日

編集済み:

2022 年 11 月 29 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by