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

Sparse stereo matching using optical flow. More...

#include <Stereo.h>

Inheritance diagram for rtabmap::StereoOpticalFlow:
Collaboration diagram for rtabmap::StereoOpticalFlow:

Public Member Functions

 StereoOpticalFlow (const ParametersMap &parameters=ParametersMap())
 Constructor.
 
virtual ~StereoOpticalFlow ()
 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 optical flow.
 
float epsilon () const
 Get the convergence threshold (epsilon)
 
virtual bool isGpuEnabled () const
 Check if GPU acceleration is enabled.
 
bool usingMinEigenVals () const
 
float minEigThreshold () const
 
float errorThreshold () const
 
- Public Member Functions inherited from rtabmap::Stereo
 Stereo (const ParametersMap &parameters=ParametersMap())
 Constructor.
 
virtual ~Stereo ()
 Virtual destructor.
 
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.
 

Additional Inherited Members

- Static Public Member Functions inherited from rtabmap::Stereo
static Stereocreate (const ParametersMap &parameters=ParametersMap())
 Factory method to create a Stereo instance.
 

Detailed Description

Sparse stereo matching using optical flow.

This class implements sparse stereo matching using optical flow (Lucas-Kanade) to find corresponding feature points between stereo image pairs. It extends the base Stereo class with optical flow-based matching, which can be more robust than simple block matching, especially for textured regions.

The algorithm uses pyramidal Lucas-Kanade optical flow to track feature points from the left image to the right image, then filters the results based on disparity constraints.

Note
Input images must be grayscale (CV_8UC1).
GPU acceleration is available if RTAB-Map is built with OpenCV CUDA support.
See also
Stereo for block matching-based implementation

Definition at line 219 of file Stereo.h.

Constructor & Destructor Documentation

◆ StereoOpticalFlow()

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

Constructor.

Initializes a StereoOpticalFlow 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.

◆ ~StereoOpticalFlow()

virtual rtabmap::StereoOpticalFlow::~StereoOpticalFlow ( )
inlinevirtual

Virtual destructor.

Definition at line 235 of file Stereo.h.

Member Function Documentation

◆ parseParameters()

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

Parse parameters from a parameters map.

Updates the algorithm's configuration based on the provided parameters map. First calls the base class parseParameters(), then parses optical flow-specific parameters:

Parameters
parametersParameters map containing configuration values
Note
If GPU is enabled but RTAB-Map is not built with OpenCV CUDA support, GPU will be automatically disabled and an error message will be logged.

Reimplemented from rtabmap::Stereo.

◆ computeCorrespondences()

virtual std::vector< cv::Point2f > rtabmap::StereoOpticalFlow::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 optical flow.

Finds corresponding points in the right stereo image for the given points in the left stereo image using pyramidal Lucas-Kanade optical flow. The results are filtered based on disparity constraints (minDisparity to maxDisparity).

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).
If GPU is enabled, the GPU version of this method is called automatically.

Reimplemented from rtabmap::Stereo.

◆ epsilon()

float rtabmap::StereoOpticalFlow::epsilon ( ) const
inline

Get the convergence threshold (epsilon)

Returns
Convergence threshold for optical flow iteration termination

Definition at line 302 of file Stereo.h.

◆ isGpuEnabled()

virtual bool rtabmap::StereoOpticalFlow::isGpuEnabled ( ) const
virtual

Check if GPU acceleration is enabled.

Returns whether GPU acceleration is currently enabled for optical flow computation. GPU acceleration requires OpenCV CUDA support to be compiled in.

Returns
true if GPU is enabled and available, false otherwise

Reimplemented from rtabmap::Stereo.

◆ usingMinEigenVals()

bool rtabmap::StereoOpticalFlow::usingMinEigenVals ( ) const
inline

Definition at line 314 of file Stereo.h.

◆ minEigThreshold()

float rtabmap::StereoOpticalFlow::minEigThreshold ( ) const
inline

Definition at line 315 of file Stereo.h.

◆ errorThreshold()

float rtabmap::StereoOpticalFlow::errorThreshold ( ) const
inline

Definition at line 316 of file Stereo.h.


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