RTAB-Map 0.23.10
Real-Time Appearance-Based Mapping
Loading...
Searching...
No Matches
rtabmap::Stereo Class Reference

Sparse stereo matching using block matching. More...

#include <Stereo.h>

Inheritance diagram for rtabmap::Stereo:

Public Member Functions

 Stereo (const ParametersMap &parameters=ParametersMap())
 Constructor.
 
virtual ~Stereo ()
 Virtual destructor.
 
virtual void parseParameters (const ParametersMap &parameters)
 Parse parameters from a parameters map.
 
virtual std::vector< cv::Point2f > computeCorrespondences (const cv::Mat &leftImage, const cv::Mat &rightImage, const std::vector< cv::Point2f > &leftCorners, std::vector< unsigned char > &status) const
 Compute stereo correspondences using block matching.
 
cv::Size winSize () const
 Get the search window size.
 
int iterations () const
 Get the number of iterations.
 
int maxLevel () const
 Get the maximum pyramid level.
 
float minDisparity () const
 Get the minimum disparity value.
 
float maxDisparity () const
 Get the maximum disparity value.
 
bool winSSD () const
 Check if SSD (Sum of Squared Differences) is used.
 
virtual bool isGpuEnabled () const
 Check if GPU acceleration is enabled.
 

Static Public Member Functions

static Stereocreate (const ParametersMap &parameters=ParametersMap())
 Factory method to create a Stereo instance.
 

Detailed Description

Sparse stereo matching using block matching.

This class implements sparse stereo matching to find corresponding feature points between stereo image pairs using block matching with a search window. Unlike dense stereo matching, this class works with sparse feature points rather than computing disparity for every pixel.

The algorithm uses a pyramidal approach for efficiency, searching for correspondences within a specified disparity range using either SAD (Sum of Absolute Differences) or SSD (Sum of Squared Differences) as the matching cost.

Note
Input images must be grayscale (CV_8UC1).
See also
StereoOpticalFlow for an alternative implementation using optical flow
StereoDense for dense stereo matching

Definition at line 55 of file Stereo.h.

Constructor & Destructor Documentation

◆ Stereo()

rtabmap::Stereo::Stereo ( const ParametersMap parameters = ParametersMap())

Constructor.

Initializes a Stereo instance with default parameter values and then parses the provided parameters map to override defaults.

Parameters
parametersOptional parameters map containing configuration values. If empty, default values are used.

◆ ~Stereo()

virtual rtabmap::Stereo::~Stereo ( )
inlinevirtual

Virtual destructor.

Definition at line 87 of file Stereo.h.

Member Function Documentation

◆ create()

static Stereo * rtabmap::Stereo::create ( const ParametersMap parameters = ParametersMap())
static

Factory method to create a Stereo instance.

Creates a Stereo instance based on the stereo optical flow parameter in the provided parameters map. If optical flow is enabled, creates a StereoOpticalFlow instance; otherwise, creates a standard Stereo instance.

Parameters
parametersParameters map containing configuration values. The Parameters::kStereoOpticalFlow() parameter determines which implementation to create.
Returns
Pointer to the created Stereo instance (caller owns the memory). Returns StereoOpticalFlow if optical flow is enabled, otherwise Stereo.

◆ parseParameters()

virtual void rtabmap::Stereo::parseParameters ( const ParametersMap parameters)
virtual

Parse parameters from a parameters map.

Updates the algorithm's configuration based on the provided parameters map. Supported parameters:

Parameters
parametersParameters map containing configuration values

Reimplemented in rtabmap::StereoOpticalFlow.

◆ computeCorrespondences()

virtual std::vector< cv::Point2f > rtabmap::Stereo::computeCorrespondences ( const cv::Mat &  leftImage,
const cv::Mat &  rightImage,
const std::vector< cv::Point2f > &  leftCorners,
std::vector< unsigned char > &  status 
) const
virtual

Compute stereo correspondences using block matching.

Finds corresponding points in the right stereo image for the given points in the left stereo image using block matching with a search window. The algorithm uses a pyramidal approach for efficiency.

Parameters
leftImageLeft stereo image (must be CV_8UC1 grayscale)
rightImageRight stereo image (must be CV_8UC1 grayscale)
leftCornersInput vector of feature points in the left image
statusOutput vector indicating which correspondences are valid (1) or invalid (0). The size matches leftCorners.size().
Returns
Vector of corresponding points in the right image. The size matches leftCorners.size(). Invalid correspondences may have coordinates outside the image bounds.
Note
Both input images must be grayscale (CV_8UC1).
The algorithm searches for correspondences within the disparity range [minDisparity(), maxDisparity()] and uses a search window of size winSize().

Reimplemented in rtabmap::StereoOpticalFlow.

◆ winSize()

cv::Size rtabmap::Stereo::winSize ( ) const
inline

Get the search window size.

Returns
Search window size as cv::Size(winWidth_, winHeight_)

Definition at line 154 of file Stereo.h.

◆ iterations()

int rtabmap::Stereo::iterations ( ) const
inline

Get the number of iterations.

Returns
Number of iterations for the matching algorithm

Definition at line 160 of file Stereo.h.

◆ maxLevel()

int rtabmap::Stereo::maxLevel ( ) const
inline

Get the maximum pyramid level.

Returns
Maximum pyramid level used in the pyramidal approach

Definition at line 166 of file Stereo.h.

◆ minDisparity()

float rtabmap::Stereo::minDisparity ( ) const
inline

Get the minimum disparity value.

Returns
Minimum disparity value to search (in pixels)

Definition at line 172 of file Stereo.h.

◆ maxDisparity()

float rtabmap::Stereo::maxDisparity ( ) const
inline

Get the maximum disparity value.

Returns
Maximum disparity value to search (in pixels)

Definition at line 178 of file Stereo.h.

◆ winSSD()

bool rtabmap::Stereo::winSSD ( ) const
inline

Check if SSD (Sum of Squared Differences) is used.

Returns
true if SSD is used, false if SAD (Sum of Absolute Differences) is used

Definition at line 184 of file Stereo.h.

◆ isGpuEnabled()

virtual bool rtabmap::Stereo::isGpuEnabled ( ) const
inlinevirtual

Check if GPU acceleration is enabled.

Returns
Always returns false for the base Stereo class

Reimplemented in rtabmap::StereoOpticalFlow.

Definition at line 190 of file Stereo.h.


The documentation for this class was generated from the following file: