主要内容

本页采用了机器翻译。点击此处可查看英文原文。

视觉 SLAM

使用单目、RGB-D 或立体相机进行实时视觉定位和地图构建 (vSLAM),支持惯性传感器融合和部署

视觉同步定位与地图构建 (vSLAM) 是使用视觉输入估计相机位置和姿态,并同时进行环境地图构建的过程。Computer Vision Toolbox™ 支持单目、RGB-D 和立体相机的 vSLAM 工作流,并可选择惯性传感器融合以提高精度。这些功能对于机器人、增强现实和自主导航等应用至关重要。有关选择 vSLAM 工作流的指南,请参阅Choose SLAM Workflow Based on Sensor Data

每个视觉 SLAM 对象(monovslamrgbdvslamstereovslam)都提供了即用型工具,可添加帧、跟踪关键帧、计算三维地图点、估计相机位姿、执行闭环检测以及在整个相机轨迹中可视化数据。您还可以通过使用 compareTrajectories 函数将估计的相机轨迹与真实值进行比较,以评估 vSLAM 算法的性能。工具箱还提供了构建您自己的视觉 SLAM 流程的功能。

您可以使用该工具箱执行 vSLAM 算法的代码生成和部署。有关详细信息,请参阅Build and Deploy Visual SLAM Algorithm with ROS in MATLABPerformant and Deployable Monocular Visual SLAM

函数

全部展开

monovslamVisual simultaneous localization and mapping (vSLAM) and visual-inertial sensor fusion with monocular camera (自 R2023b 起)
addFrameAdd image frame to visual SLAM object (自 R2023b 起)
hasNewKeyFrameCheck if new key frame added in visual SLAM object (自 R2023b 起)
checkStatusCheck status of visual SLAM object (自 R2023b 起)
isDoneEnd-of-file status (logical)
mapPointsBuild 3-D map of world points (自 R2023b 起)
posesAbsolute camera poses of key frames (自 R2023b 起)
plotPlot 3-D map points and estimated camera trajectory in visual SLAM (自 R2023b 起)
resetReset visual SLAM object (自 R2023b 起)
rgbdvslamFeature-based visual simultaneous localization and mapping (vSLAM) and visual-inertial sensor fusion with RGB-D camera (自 R2024a 起)
addFrameAdd pair of color and depth images to RGB-D visual SLAM object (自 R2024a 起)
hasNewKeyFrameCheck if new key frame added in RGB-D visual SLAM object (自 R2024a 起)
checkStatusCheck status of visual RGB-D SLAM object (自 R2024a 起)
isDoneEnd-of-processing status for RGB-D visual SLAM object (自 R2024a 起)
mapPointsBuild 3-D map of world points from RGB-D vSLAM object (自 R2024a 起)
posesAbsolute camera poses of RGB-D vSLAM key frames (自 R2024a 起)
plotPlot 3-D map points and estimated camera trajectory in RGB-D visual SLAM (自 R2024a 起)
resetReset RGB-D visual SLAM object (自 R2024a 起)
stereovslamFeature-based visual simultaneous localization and mapping (vSLAM) and visual-inertial sensor fusion with stereo camera (自 R2024a 起)
addFrameAdd pair of color and depth images to stereo visual SLAM object (自 R2024a 起)
hasNewKeyFrameCheck if new key frame added in stereo visual SLAM object (自 R2024a 起)
checkStatusCheck status of stereo visual SLAM object (自 R2024a 起)
isDoneEnd-of-processing status for stereo visual SLAM object (自 R2024a 起)
mapPointsBuild 3-D map of world points from stereo vSLAM object (自 R2024a 起)
posesAbsolute camera poses of stereo key frames (自 R2024a 起)
plotPlot 3-D map points and estimated camera trajectory in stereo visual SLAM (自 R2024a 起)
resetReset stereo visual SLAM object (自 R2024a 起)
compareTrajectoriesCompare estimated trajectory against ground truth (自 R2024b 起)
trajectoryErrorMetricsStore accuracy metrics for trajectories (自 R2024b 起)
imshow显示图像
showMatchedFeatures显示相应的特征点
plotPlot image view set views and connections
plotCameraPlot camera in 3-D coordinates
pcshowPlot 3-D point cloud
pcplayerVisualize streaming 3-D point cloud data

检测、提取和匹配特征

detectSURFFeatures检测 SURF 特征
detectORBFeatures检测 ORB 关键点
extractFeatures提取兴趣点描述符
matchFeatures查找匹配的特征
matchFeaturesInRadiusFind matching features within specified radius

重建三维结构

triangulate立体图像中未去畸变的匹配点的三维位置
img2world2dDetermine world coordinates of image points (自 R2022b 起)
world2img将世界点投影到图像中 (自 R2022b 起)

估计运动

estgeotform2dEstimate 2-D geometric transformation from matching point pairs (自 R2022b 起)
estgeotform3dEstimate 3-D geometric transformation from matching point pairs (自 R2022b 起)
estimateFundamentalMatrixEstimate fundamental matrix from corresponding points in stereo images
estworldposeEstimate camera pose from 3-D to 2-D point correspondences (自 R2022b 起)
findWorldPointsInViewFind world points observed in view
findWorldPointsInTracksFind world points that correspond to point tracks
estrelposeCalculate relative rotation and translation between camera poses (自 R2022b 起)

优化运动和三维结构

optimizePosesOptimize absolute poses using relative pose constraints
createPoseGraphCreate pose graph
bundleAdjustmentAdjust collection of 3-D points and camera poses
bundleAdjustmentMotionAdjust collection of 3-D points and camera poses using motion-only bundle adjustment
bundleAdjustmentStructureRefine 3-D points using structure-only bundle adjustment

闭环检测

bagOfFeaturesBag of visual words object
bagOfFeaturesDBoWBag of visual words using DBoW2 library (自 R2024b 起)
dbowLoopDetectorDetect loop closure using visual features (自 R2024b 起)
indexImagesCreate image search index
invertedImageIndexSearch index that maps visual words to images

管理数据

imageviewsetManage data for structure-from-motion, visual odometry, and visual SLAM
worldpointsetManage 3-D to 2-D point correspondences

变换

se3SE(3) homogeneous transformation (自 R2026a 起)
so3SO(3) rotation (自 R2026a 起)

主题

即用型视觉 SLAM 函数

构建您自己的视觉 SLAM 流程

精选示例