Point Cloud Library (PCL)
1.11.1-dev
|
40 #include <pcl/point_cloud.h>
55 const auto sad_min_1st_part_it = std::min_element(acc, acc + dbest - 1);
56 const auto sad_min_2nd_part_it = std::min_element(acc + dbest + 2, acc + maxdisp);
58 const auto sad_second_min = std::min(*sad_min_1st_part_it, *sad_min_2nd_part_it);
60 if ((sad_min * precision) > ((precision - ratio_filter) * sad_second_min)) {
75 const auto da_condition = (dbest > 1);
76 const auto db_condition = (dbest < maxdisp - 2);
77 const auto da_index = dbest + 2 - (da_condition << 2);
78 const auto db_index = dbest - 2 + (db_condition << 2);
80 const auto da = acc[da_index] - acc[dbest];
81 const auto db = acc[db_index] - acc[dbest];
82 if ((da + db) < peak_filter) {
123 max_disp_ = max_disp;
146 ratio_filter_ = ratio_filter;
157 peak_filter_ = peak_filter;
168 is_pre_proc_ = is_pre_proc;
181 is_lr_check_ = is_lr_check;
194 lr_check_th_ = lr_check_th;
206 compute(
unsigned char* ref_img,
unsigned char* trg_img,
int width,
int height) = 0;
228 medianFilter(
int radius);
246 getPointCloud(
float u_c,
270 getPointCloud(
float u_c,
332 preProcessing(
unsigned char* img,
unsigned char* pp_img) = 0;
335 imgFlip(
unsigned char*& img) = 0;
338 compute_impl(
unsigned char* ref_img,
unsigned char* trg_img) = 0;
346 int den = (s1 + s3 - 2 * s2);
348 return (
static_cast<short int>(16 * dbest + (((s1 - s3) * 8) / den)));
349 return (
static_cast<short int>(dbest * 16));
355 float den = (s1 + s3 - 2 * s2);
357 return (
static_cast<short int>(16 * dbest +
358 std::floor(.5 + (((s1 - s3) * 8) / den))));
359 return (
static_cast<short int>(dbest * 16));
387 compute(
unsigned char* ref_img,
388 unsigned char* trg_img,
390 int height)
override;
407 compute_impl(
unsigned char* ref_img,
unsigned char* trg_img)
override = 0;
410 preProcessing(
unsigned char* img,
unsigned char* pp_img)
override;
413 imgFlip(
unsigned char*& img)
override;
445 compute_impl(
unsigned char* ref_img,
unsigned char* trg_img)
override;
508 smoothness_weak_ = smoothness_weak;
517 smoothness_strong_ = smoothness_strong;
522 compute_impl(
unsigned char* ref_img,
unsigned char* trg_img)
override;
531 int smoothness_strong_;
532 int smoothness_weak_;
void setLeftRightCheckThreshold(int lr_check_th)
setter for the left-right consistency check threshold
int width_
number of pixels per column of the input stereo pair .
short int computeStereoSubpixel(int dbest, int s1, int s2, int s3)
int ratio_filter_
Threshold for the ratio filter, .
Block based (or fixed window) Stereo Matching class.
void setRatioFilter(int ratio_filter)
setter for the value of the ratio filter
void setSmoothStrong(int smoothness_strong)
"strong" smoothness penalty used within 2-pass Scanline Optimization
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
int lr_check_th_
Threshold for the left-right consistency check, typically either 0 or 1.
void setXOffset(int x_off)
setter for horizontal offset, i.e.
Stereo Matching abstract class for Grayscale images.
short int doStereoRatioFilter(const T *const acc, short int dbest, T sad_min, int ratio_filter, int maxdisp, int precision=100)
~AdaptiveCostSOStereoMatching()
short int * disp_map_trg_
Disparity map used for left-right check.
void setPeakFilter(int peak_filter)
setter for the value of the peak filter
bool is_lr_check_
toggle for the activation of the left-right consistency check stage
void setGammaS(int gamma_s)
setter for the spatial bandwidth used for cost aggregation based on adaptive weights
void setPreProcessing(bool is_pre_proc)
setter for the pre processing step
Stereo Matching abstract class.
~BlockBasedStereoMatching()
int max_disp_
Disparity range used for stereo processing.
bool is_pre_proc_
toggle for the activation of the pre-processing stage
int x_off_
Horizontal displacemente (x offset) used for stereo processing.
shared_ptr< PointCloud< PointT > > Ptr
unsigned char * pp_trg_img_
void setRadius(int radius)
setter for the radius (half length) of the column used for cost aggregation
short int doStereoPeakFilter(const T *const acc, short int dbest, int peak_filter, int maxdisp)
unsigned char * pp_ref_img_
Local aligned copies used for pre processing.
int height_
number of pixels per row of the input stereo pair .
short int computeStereoSubpixel(int dbest, float s1, float s2, float s3)
void setMaxDisparity(int max_disp)
setter for number of disparity candidates (disparity range)
unsigned char * ref_img_
Local aligned copies of the cloud data.
void setLeftRightCheck(bool is_lr_check)
setter for the left-right consistency check stage, that eliminates inconsistent/wrong disparity value...
Adaptive Cost 2-pass Scanline Optimization Stereo Matching class.
short int * disp_map_
The internal disparity map.
int peak_filter_
Threshold for the peak filter, .
void setRadius(int radius)
setter for the radius of the squared window