AdaptiveCostSOStereoMatching ()
~AdaptiveCostSOStereoMatching ()
void setRadius (int radius)
setter for the radius (half length) of the column used for cost aggregation
void setGammaS (int gamma_s)
setter for the spatial bandwidth used for cost aggregation based on adaptive weights
void setGammaC (int gamma_c)
setter for the color bandwidth used for cost aggregation based on adaptive weights
void setSmoothWeak (int smoothness_weak)
"weak" smoothness penalty used within 2-pass Scanline Optimization
void setSmoothStrong (int smoothness_strong)
"strong" smoothness penalty used within 2-pass Scanline Optimization
GrayStereoMatching ()
~GrayStereoMatching ()
void compute (unsigned char *ref_img, unsigned char *trg_img, int width, int height) override
stereo processing, it computes a disparity map stored internally by the class
void compute (pcl::PointCloud < pcl::RGB > &ref, pcl::PointCloud < pcl::RGB > &trg) override
stereo processing, it computes a disparity map stored internally by the class
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
void compute_impl (unsigned char *ref_img, unsigned char *trg_img) override=0
void preProcessing (unsigned char *img, unsigned char *pp_img) override
void imgFlip (unsigned char *&img) override
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)
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.
Adaptive Cost 2-pass Scanline Optimization Stereo Matching class.
This class implements an adaptive-cost stereo matching algorithm based on 2-pass Scanline Optimization. The algorithm is inspired by the paper: [1] L. Wang et al., "High Quality Real-time Stereo using Adaptive Cost Aggregation and Dynamic
Programming", 3DPVT 2006 Cost aggregation is performed using adaptive weigths computed on a single column as proposed in [1]. Instead of using Dynamic Programming as in [1], the optimization is performed via 2-pass Scanline Optimization. The algorithm is based on the Sum of Absolute Differences (SAD) matching function Only works with grayscale (single channel) rectified images
Author Federico Tombari (feder.nosp@m. ico..nosp@m. tomba.nosp@m. ri@u.nosp@m. nibo..nosp@m. it )
Definition at line 464 of file stereo_matching.h .