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

Abstract base class for dense stereo matching algorithms. More...

#include <StereoDense.h>

Inheritance diagram for rtabmap::StereoDense:

Public Types

enum  Type { kTypeBM = 0 , kTypeSGBM = 1 }
 Enumeration of available stereo matching algorithm types. More...
 

Public Member Functions

virtual ~StereoDense ()
 Virtual destructor.
 
virtual void parseParameters (const ParametersMap &parameters)
 Parse parameters from a parameters map.
 
virtual cv::Mat computeDisparity (const cv::Mat &leftImage, const cv::Mat &rightImage) const =0
 Compute disparity map from stereo image pair.
 

Static Public Member Functions

static StereoDensecreate (const ParametersMap &parameters)
 Factory method to create a StereoDense instance from parameters.
 
static StereoDensecreate (StereoDense::Type type, const ParametersMap &parameters=ParametersMap())
 Factory method to create a StereoDense instance of a specific type.
 

Protected Member Functions

 StereoDense (const ParametersMap &parameters=ParametersMap())
 Protected constructor.
 

Detailed Description

Abstract base class for dense stereo matching algorithms.

This class provides the interface for dense stereo matching algorithms that compute disparity maps from stereo image pairs. It uses a factory pattern to create specific implementations (Block Matching or Semi-Global Block Matching).

The disparity map is a 16-bit signed integer image (CV_16SC1) where each pixel value represents the horizontal displacement between corresponding pixels in the left and right stereo images. Higher disparity values indicate closer objects.

Note
Both input images must have the same size and be either grayscale (CV_8UC1) or color (CV_8UC3). Color images are automatically converted to grayscale.

Definition at line 53 of file StereoDense.h.

Member Enumeration Documentation

◆ Type

Enumeration of available stereo matching algorithm types.

Enumerator
kTypeBM 

Block Matching algorithm (faster, less accurate)

kTypeSGBM 

Semi-Global Block Matching algorithm (slower, more accurate)

Definition at line 59 of file StereoDense.h.

Constructor & Destructor Documentation

◆ ~StereoDense()

virtual rtabmap::StereoDense::~StereoDense ( )
inlinevirtual

Virtual destructor.

Definition at line 93 of file StereoDense.h.

◆ StereoDense()

rtabmap::StereoDense::StereoDense ( const ParametersMap parameters = ParametersMap())
inlineprotected

Protected constructor.

Parameters
parametersOptional parameters map for initialization

Definition at line 129 of file StereoDense.h.

Member Function Documentation

◆ create() [1/2]

static StereoDense * rtabmap::StereoDense::create ( const ParametersMap parameters)
static

Factory method to create a StereoDense instance from parameters.

Creates a StereoDense instance based on the stereo dense strategy parameter in the provided parameters map. The strategy is determined by the Parameters::kStereoDenseStrategy() parameter.

Parameters
parametersParameters map containing configuration values
Returns
Pointer to the created StereoDense instance (caller owns the memory)
See also
create(Type, const ParametersMap&)

◆ create() [2/2]

static StereoDense * rtabmap::StereoDense::create ( StereoDense::Type  type,
const ParametersMap parameters = ParametersMap() 
)
static

Factory method to create a StereoDense instance of a specific type.

Creates a StereoDense instance of the specified type with the given parameters.

Parameters
typeThe type of stereo matching algorithm to create
parametersOptional parameters map containing configuration values
Returns
Pointer to the created StereoDense instance (caller owns the memory)
See also
create(const ParametersMap&)

◆ parseParameters()

virtual void rtabmap::StereoDense::parseParameters ( const ParametersMap parameters)
inlinevirtual

Parse parameters from a parameters map.

Updates the algorithm's configuration based on the provided parameters map. Derived classes should override this method to parse their specific parameters.

Parameters
parametersParameters map containing configuration values

Reimplemented in rtabmap::StereoBM, and rtabmap::StereoSGBM.

Definition at line 103 of file StereoDense.h.

◆ computeDisparity()

virtual cv::Mat rtabmap::StereoDense::computeDisparity ( const cv::Mat &  leftImage,
const cv::Mat &  rightImage 
) const
pure virtual

Compute disparity map from stereo image pair.

Computes a disparity map from the given left and right stereo images. The images must have the same size and be either grayscale (CV_8UC1) or color (CV_8UC3). Color images are automatically converted to grayscale.

Parameters
leftImageLeft stereo image (CV_8UC1 or CV_8UC3)
rightImageRight stereo image (CV_8UC1 or CV_8UC3), must have same size as leftImage
Returns
Disparity map as a 16-bit signed integer image (CV_16SC1)
Note
The disparity values are stored as fixed-point numbers with 4 fractional bits. To get the actual disparity, divide by 16.
Invalid disparities are typically represented by negative values or zero.

Implemented in rtabmap::StereoBM, and rtabmap::StereoSGBM.


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