Point Cloud Library (PCL) 1.12.0
|
Stereo Matching abstract class. More...
#include <pcl/stereo/stereo_matching.h>
Public Member Functions | |
StereoMatching () | |
virtual | ~StereoMatching () |
void | setMaxDisparity (int max_disp) |
setter for number of disparity candidates (disparity range) | |
void | setXOffset (int x_off) |
setter for horizontal offset, i.e. | |
void | setRatioFilter (int ratio_filter) |
setter for the value of the ratio filter | |
void | setPeakFilter (int peak_filter) |
setter for the value of the peak filter | |
void | setPreProcessing (bool is_pre_proc) |
setter for the pre processing step | |
void | setLeftRightCheck (bool is_lr_check) |
setter for the left-right consistency check stage, that eliminates inconsistent/wrong disparity values from the disparity map at approx. | |
void | setLeftRightCheckThreshold (int lr_check_th) |
setter for the left-right consistency check threshold | |
virtual void | compute (unsigned char *ref_img, unsigned char *trg_img, int width, int height)=0 |
stereo processing, it computes a disparity map stored internally by the class | |
virtual void | compute (pcl::PointCloud< pcl::RGB > &ref, pcl::PointCloud< pcl::RGB > &trg)=0 |
stereo processing, it computes a disparity map stored internally by the class | |
void | medianFilter (int radius) |
median filter applied on the previously computed disparity map | |
virtual bool | getPointCloud (float u_c, float v_c, float focal, float baseline, pcl::PointCloud< pcl::PointXYZ >::Ptr cloud) |
computation of the 3D point cloud from the previously computed disparity map without color information | |
virtual bool | getPointCloud (float u_c, float v_c, float focal, float baseline, pcl::PointCloud< pcl::PointXYZRGB >::Ptr cloud, pcl::PointCloud< pcl::RGB >::Ptr texture) |
computation of the 3D point cloud from the previously computed disparity map including color information | |
void | getVisualMap (pcl::PointCloud< pcl::RGB >::Ptr vMap) |
computation of a pcl::RGB cloud with scaled disparity values it can be used to display a rescaled version of the disparity map by means of the pcl::ImageViewer invalid disparity values are shown in green | |
Protected Member Functions | |
virtual void | preProcessing (unsigned char *img, unsigned char *pp_img)=0 |
virtual void | imgFlip (unsigned char *&img)=0 |
virtual void | compute_impl (unsigned char *ref_img, unsigned char *trg_img)=0 |
void | leftRightCheck () |
short int | computeStereoSubpixel (int dbest, int s1, int s2, int s3) |
short int | computeStereoSubpixel (int dbest, float s1, float s2, float s3) |
Protected Attributes | |
short int * | disp_map_ |
The internal disparity map. | |
unsigned char * | ref_img_ |
Local aligned copies of the cloud data. | |
unsigned char * | trg_img_ |
short int * | disp_map_trg_ |
Disparity map used for left-right check. | |
unsigned char * | pp_ref_img_ |
Local aligned copies used for pre processing. | |
unsigned char * | pp_trg_img_ |
int | width_ |
number of pixels per column of the input stereo pair . | |
int | height_ |
number of pixels per row of the input stereo pair . | |
int | max_disp_ |
Disparity range used for stereo processing. | |
int | x_off_ |
Horizontal displacemente (x offset) used for stereo processing. | |
int | ratio_filter_ |
Threshold for the ratio filter, ![]() | |
int | peak_filter_ |
Threshold for the peak filter, ![]() | |
bool | is_pre_proc_ |
toggle for the activation of the pre-processing stage | |
bool | is_lr_check_ |
toggle for the activation of the left-right consistency check stage | |
int | lr_check_th_ |
Threshold for the left-right consistency check, typically either 0 or 1. | |
Stereo Matching abstract class.
The class performs stereo matching on a rectified stereo pair.
Includes the following functionalities:
Definition at line 110 of file stereo_matching.h.
pcl::StereoMatching::StereoMatching | ( | ) |
|
virtual |
|
pure virtual |
stereo processing, it computes a disparity map stored internally by the class
[in] | ref | point cloud of pcl::RGB type containing the pixels of the reference image (left image) |
[in] | trg | point cloud of pcl::RGB type containing the pixels of the target image (right image) |
Implemented in pcl::GrayStereoMatching.
|
pure virtual |
stereo processing, it computes a disparity map stored internally by the class
[in] | ref_img | reference array of image pixels (left image) |
[in] | trg_img | target array of image pixels (right image) |
[in] | width | number of elements per row for both input arrays |
[in] | height | number of elements per column for both input arrays |
Implemented in pcl::GrayStereoMatching.
|
protectedpure virtual |
Implemented in pcl::GrayStereoMatching.
|
inlineprotected |
Definition at line 353 of file stereo_matching.h.
|
inlineprotected |
Definition at line 344 of file stereo_matching.h.
|
virtual |
computation of the 3D point cloud from the previously computed disparity map without color information
[in] | u_c | horizontal coordinate of the principal point (calibration parameter) |
[in] | v_c | vertical coordinate of the principal point (calibration parameter) |
[in] | focal | focal length in pixels (calibration parameter) |
[in] | baseline | distance between the two cameras (calibration parameter); the measure unit used to specify this parameter will be the same as the 3D points in the output point cloud |
[out] | cloud | output 3D point cloud; it is organized and non-dense, with NaNs where 3D points are invalid |
|
virtual |
computation of the 3D point cloud from the previously computed disparity map including color information
[in] | u_c | horizontal coordinate of the principal point (calibration parameter) |
[in] | v_c | vertical coordinate of the principal point (calibration parameter) |
[in] | focal | focal length in pixels (calibration parameter) |
[in] | baseline | distance between the two cameras (calibration parameter); the measure unit used to specify this parameter will be the same as the 3D points in the output point cloud |
[out] | cloud | output 3D point cloud; it is organized and non-dense, with NaNs where 3D points are invalid |
[in] | texture | 3D cloud (same size of the output cloud) used to associate to each 3D point of the output cloud a color triplet |
void pcl::StereoMatching::getVisualMap | ( | pcl::PointCloud< pcl::RGB >::Ptr | vMap | ) |
computation of a pcl::RGB cloud with scaled disparity values it can be used to display a rescaled version of the disparity map by means of the pcl::ImageViewer invalid disparity values are shown in green
[out] | vMap | output cloud |
Implemented in pcl::GrayStereoMatching.
|
protected |
median filter applied on the previously computed disparity map
[in] | radius | radius of the squared window used to compute the median filter; the window side is equal to 2*radius + 1 |
|
protectedpure virtual |
Implemented in pcl::GrayStereoMatching.
setter for the left-right consistency check stage, that eliminates inconsistent/wrong disparity values from the disparity map at approx.
twice the processing cost of the selected stereo algorithm
[in] | is_lr_check | setting the boolean to true activates the left-right consistency check |
Definition at line 179 of file stereo_matching.h.
setter for the left-right consistency check threshold
[in] | lr_check_th | sets the value of the left-right consistency check threshold only has some influence if the left-right check is active typically has either the value 0 ("strong" consistency check, more points being filtered) or 1 ("weak" consistency check, less points being filtered) |
Definition at line 192 of file stereo_matching.h.
setter for number of disparity candidates (disparity range)
[in] | max_disp | number of disparity candidates (disparity range); has to be > 0 |
Definition at line 121 of file stereo_matching.h.
setter for the value of the peak filter
[in] | peak_filter | value of the peak filter; it is a number in the range [0, inf] (0: no filtering action) |
Definition at line 155 of file stereo_matching.h.
setter for the pre processing step
[in] | is_pre_proc | setting the boolean to true activates the pre-processing step for both stereo images |
Definition at line 166 of file stereo_matching.h.
setter for the value of the ratio filter
[in] | ratio_filter | value of the ratio filter; it is a number in the range [0, 100] (0: no filtering action; 100: all disparities are filtered) |
Definition at line 144 of file stereo_matching.h.
setter for horizontal offset, i.e.
number of pixels to shift the disparity range over the target image
[in] | x_off | horizontal offset value; has to be >= 0 |
Definition at line 132 of file stereo_matching.h.
The internal disparity map.
Definition at line 291 of file stereo_matching.h.
Disparity map used for left-right check.
Definition at line 298 of file stereo_matching.h.
|
protected |
number of pixels per row of the input stereo pair .
Definition at line 308 of file stereo_matching.h.
|
protected |
toggle for the activation of the left-right consistency check stage
Definition at line 326 of file stereo_matching.h.
|
protected |
toggle for the activation of the pre-processing stage
Definition at line 323 of file stereo_matching.h.
|
protected |
Threshold for the left-right consistency check, typically either 0 or 1.
Definition at line 329 of file stereo_matching.h.
|
protected |
Disparity range used for stereo processing.
Definition at line 311 of file stereo_matching.h.
|
protected |
Threshold for the peak filter,
Definition at line 320 of file stereo_matching.h.
Local aligned copies used for pre processing.
Definition at line 301 of file stereo_matching.h.
Definition at line 302 of file stereo_matching.h.
|
protected |
Threshold for the ratio filter,
Definition at line 317 of file stereo_matching.h.
Local aligned copies of the cloud data.
Definition at line 294 of file stereo_matching.h.
Definition at line 295 of file stereo_matching.h.
|
protected |
number of pixels per column of the input stereo pair .
Definition at line 305 of file stereo_matching.h.
|
protected |
Horizontal displacemente (x offset) used for stereo processing.
Definition at line 314 of file stereo_matching.h.