stereovslam
Feature-based visual simultaneous localization and mapping (vSLAM) and visual-inertial sensor fusion with stereo camera
Since R2024a
Description
Use the stereovslam
object to perform visual simultaneous
localization and mapping (vSLAM) with stereo camera data. To learn more about visual SLAM, see
Implement Visual SLAM in MATLAB.
The stereovslam
object extracts Oriented FAST and Rotated BRIEF (ORB)
features from incrementally read images, and then tracks those features to estimate camera
poses, identify key frames, and reconstruct a 3-D environment. The vSLAM algorithm also
searches for loop closures using the bag-of-features algorithm, and then optimizes the camera
poses using pose graph optimization. You can enhance the accuracy and robustness of the SLAM
by integrating this object with IMU data to perform visual-inertial sensor fusion.
Creation
Syntax
Description
creates a stereo visual SLAM object, vslam
= stereovslam(intrinsics
,baseline
)vslam
, using the rectified
stereo camera intrinsic parameters intrinsics
, and the
baseline
distance between the rectified left and right
cameras.
The object represents 3-D map points and camera poses in world coordinates, and
assumes the camera pose of the first key frame is an identity rigidtform3d
transform.
Note
The stereovslam
object runs on multiple threads internally, which can delay the processing of an image frame added by using the addFrame
function. Additionally, the object running on multiple threads means the current frame the object is processing can be different than the recently added frame.
creates a stereo visual SLAM object vslam
= stereovslam(reprojectionMatrix
,imageSize
)vslam
using the stereo camera
reprojection matrix, reprojectionMatrix
, and the image size,
imageSize
.
performs stereo visual-inertial SLAM based on the specified
vslam
= stereovslam(___,imuParameters
)imuParameters
. Using this argument with IMU data, requires the
Navigation Toolbox™
sets properties using one or more name-value arguments in addition to any combination of
input arguments from previous syntaxes. For example, vslam
= stereovslam(___,PropertyName=Value
)MaxNumPoints=850
sets the maximum number of ORB feature points to extract from each image to
850
.
Input Arguments
Properties
Object Functions
addFrame | Add pair of color and depth images to stereo visual SLAM object |
checkStatus | Check status of stereo visual SLAM object |
hasNewKeyFrame | Check if new key frame added in stereo visual SLAM object |
isDone | End-of-processing status for stereo visual SLAM object |
mapPoints | Build 3-D map of world points from stereo vSLAM object |
plot | Plot 3-D map points and estimated camera trajectory in stereo visual SLAM |
poses | Absolute camera poses of stereo key frames |
reset | Reset stereo visual SLAM object |
Examples
Tips
The
stereovslam
object:Does not account for lens distortion. You can undistort the images by using the
undistortImage
function before adding images.Assumes images have been rectified. You can rectify undistorted stereo images by using the
rectifyStereoImages
function before adding images.Runs on multiple threads internally, which can delay the processing of an image frame added by using the
addFrame
function. Additionally, the object running on multiple threads means the current frame the object is processing can be different than the most recently added frame.
The camera poses are the poses of the primary camera, which corresponds to the input image
I1
added by theaddFrame
object function.The object represents 3-D map points and camera poses in world coordinates. The object assumes the camera pose of the first key frame is an identity
rigidtform3d
transform.
References
[1] Mur-Artal and J. D. Tardós, "ORB-SLAM2: An Open-Source SLAM System for Monocular, Stereo, and RGB-D Cameras," in IEEE Transactions on Robotics, vol. 33, no. 5, pp. 1255-1262, Oct. 2017, doi: 10.1109/TRO.2017.2705103.
Extended Capabilities
Version History
Introduced in R2024aSee Also
Objects
monovslam
|rgbdvslam
|factorIMUParameters
(Navigation Toolbox) |cameraIntrinsics
|imageDatastore
|ORBPoints