MATLAB Answers

helperTrackLocalMap error with Monocular SLAM

4 views (last 30 days)
Sashamaru John
Sashamaru John on 15 May 2020
Answered: Qu Cao on 19 Aug 2020
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 Comments
Sashamaru John
Sashamaru John on 21 May 2020
Both work for me. Changing the first seems to be better than the second.

Sign in to comment.

Answers (1)

Qu Cao
Qu Cao on 19 Aug 2020
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

Community Treasure Hunt

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

Start Hunting!