![]() |
ZED Open Capture
v0.6.0
Low level camera driver for the ZED stereo camera family
|
The StereoSgbmPar class is used to store/retrieve the stereo matching parameters. More...
#include <stereo.hpp>
Public Member Functions | |
StereoSgbmPar () | |
Default constructor. More... | |
bool | load () |
load stereo matching parameters More... | |
bool | save () |
save stereo matching parameters More... | |
void | setDefaultValues () |
set default stereo matching parameters More... | |
void | print () |
print the current stereo matching parameters on standard output More... | |
Public Attributes | |
int | blockSize |
[default: 3] Matched block size. It must be an odd number >=1 . Normally, it should be somewhere in the 3..11 range. More... | |
int | minDisparity |
[default: 0] Minimum possible disparity value. Normally, it is zero but sometimes rectification algorithms can shift images, so this parameter needs to be adjusted accordingly. More... | |
int | numDisparities |
[default: 96] Maximum disparity minus minimum disparity. The value is always greater than zero. In the current implementation, this parameter must be divisible by 16. More... | |
int | mode |
Set it to StereoSGBM::MODE_HH to run the full-scale two-pass dynamic programming algorithm. It will consume O(W*H*numDisparities) bytes, which is large for 640x480 stereo and huge for HD-size pictures. By default, it is set to cv::StereoSGBM::MODE_SGBM_3WAY . More... | |
int | P1 |
[default: 24*blockSize*blockSize] The first parameter controlling the disparity smoothness. See below. More... | |
int | P2 |
[default: 4*PI]The second parameter controlling the disparity smoothness. The larger the values are, the smoother the disparity is. P1 is the penalty on the disparity change by plus or minus 1 between neighbor pixels. P2 is the penalty on the disparity change by more than 1 between neighbor pixels. The algorithm requires P2 > P1 . See stereo_match.cpp sample where some reasonably good P1 and P2 values are shown (like 8*number_of_image_channels*blockSize*blockSize and 32*number_of_image_channels*blockSize*blockSize , respectively). More... | |
int | disp12MaxDiff |
[default: 96] Maximum allowed difference (in integer pixel units) in the left-right disparity check. Set it to a non-positive value to disable the check. More... | |
int | preFilterCap |
[default: 63] Truncation value for the prefiltered image pixels. The algorithm first computes x-derivative at each pixel and clips its value by [-preFilterCap, preFilterCap] interval. The result values are passed to the Birchfield-Tomasi pixel cost function. More... | |
int | uniquenessRatio |
[default: 5] Margin in percentage by which the best (minimum) computed cost function value should "win" the second best value to consider the found match correct. Normally, a value within the 5-15 range is good enough. More... | |
int | speckleWindowSize |
[default: 255] Maximum size of smooth disparity regions to consider their noise speckles and invalidate. Set it to 0 to disable speckle filtering. Otherwise, set it somewhere in the 50-200 range. More... | |
int | speckleRange |
[default: 1] Maximum disparity variation within each connected component. If you do speckle filtering, set the parameter to a positive value, it will be implicitly multiplied by 16. Normally, 1 or 2 is good enough. More... | |
double | minDepth_mm |
[default: 300] Minimum value of depth for the extracted depth map More... | |
double | maxDepth_mm |
[default: 10000] Maximum value of depth for the extracted depth map More... | |
The StereoSgbmPar class is used to store/retrieve the stereo matching parameters.
Definition at line 19 of file stereo.hpp.
|
inline |
Default constructor.
Definition at line 25 of file stereo.hpp.
References setDefaultValues().
bool sl_oc::tools::StereoSgbmPar::load | ( | ) |
load stereo matching parameters
Definition at line 87 of file stereo.hpp.
References blockSize, disp12MaxDiff, maxDepth_mm, minDepth_mm, minDisparity, mode, numDisparities, P1, P2, preFilterCap, setDefaultValues(), speckleRange, speckleWindowSize, sl_oc::tools::STEREO_PAR_FILENAME, and uniquenessRatio.
Referenced by main().
void sl_oc::tools::StereoSgbmPar::print | ( | ) |
print the current stereo matching parameters on standard output
Definition at line 150 of file stereo.hpp.
References blockSize, disp12MaxDiff, maxDepth_mm, minDepth_mm, minDisparity, mode, numDisparities, P1, P2, preFilterCap, speckleRange, speckleWindowSize, and uniquenessRatio.
Referenced by main().
bool sl_oc::tools::StereoSgbmPar::save | ( | ) |
save stereo matching parameters
Definition at line 120 of file stereo.hpp.
References blockSize, disp12MaxDiff, maxDepth_mm, minDepth_mm, minDisparity, mode, numDisparities, preFilterCap, speckleRange, speckleWindowSize, sl_oc::tools::STEREO_PAR_FILENAME, and uniquenessRatio.
Referenced by main().
void sl_oc::tools::StereoSgbmPar::setDefaultValues | ( | ) |
set default stereo matching parameters
Definition at line 69 of file stereo.hpp.
References blockSize, disp12MaxDiff, maxDepth_mm, minDepth_mm, minDisparity, mode, numDisparities, P1, P2, preFilterCap, speckleRange, speckleWindowSize, and uniquenessRatio.
Referenced by load(), main(), and StereoSgbmPar().
int sl_oc::tools::StereoSgbmPar::blockSize |
[default: 3] Matched block size. It must be an odd number >=1 . Normally, it should be somewhere in the 3..11 range.
Definition at line 53 of file stereo.hpp.
Referenced by applyStereoMatching(), load(), main(), on_trackbar_block_size(), print(), save(), and setDefaultValues().
int sl_oc::tools::StereoSgbmPar::disp12MaxDiff |
[default: 96] Maximum allowed difference (in integer pixel units) in the left-right disparity check. Set it to a non-positive value to disable the check.
Definition at line 59 of file stereo.hpp.
Referenced by applyStereoMatching(), load(), main(), on_trackbar_disp12MaxDiff(), print(), save(), and setDefaultValues().
double sl_oc::tools::StereoSgbmPar::maxDepth_mm |
[default: 10000] Maximum value of depth for the extracted depth map
Definition at line 66 of file stereo.hpp.
Referenced by load(), main(), print(), save(), and setDefaultValues().
double sl_oc::tools::StereoSgbmPar::minDepth_mm |
[default: 300] Minimum value of depth for the extracted depth map
Definition at line 65 of file stereo.hpp.
Referenced by load(), main(), print(), save(), and setDefaultValues().
int sl_oc::tools::StereoSgbmPar::minDisparity |
[default: 0] Minimum possible disparity value. Normally, it is zero but sometimes rectification algorithms can shift images, so this parameter needs to be adjusted accordingly.
Definition at line 54 of file stereo.hpp.
Referenced by applyStereoMatching(), load(), main(), on_trackbar_min_disparities(), on_trackbar_num_disparities(), print(), save(), and setDefaultValues().
int sl_oc::tools::StereoSgbmPar::mode |
Set it to StereoSGBM::MODE_HH to run the full-scale two-pass dynamic programming algorithm. It will consume O(W*H*numDisparities) bytes, which is large for 640x480 stereo and huge for HD-size pictures. By default, it is set to cv::StereoSGBM::MODE_SGBM_3WAY
.
Definition at line 56 of file stereo.hpp.
Referenced by applyStereoMatching(), load(), main(), on_trackbar_mode(), print(), save(), and setDefaultValues().
int sl_oc::tools::StereoSgbmPar::numDisparities |
[default: 96] Maximum disparity minus minimum disparity. The value is always greater than zero. In the current implementation, this parameter must be divisible by 16.
Definition at line 55 of file stereo.hpp.
Referenced by applyStereoMatching(), load(), main(), on_trackbar_min_disparities(), on_trackbar_num_disparities(), print(), save(), and setDefaultValues().
int sl_oc::tools::StereoSgbmPar::P1 |
[default: 24*blockSize*blockSize] The first parameter controlling the disparity smoothness. See below.
Definition at line 57 of file stereo.hpp.
Referenced by applyStereoMatching(), load(), main(), on_trackbar_block_size(), print(), and setDefaultValues().
int sl_oc::tools::StereoSgbmPar::P2 |
[default: 4*PI]The second parameter controlling the disparity smoothness. The larger the values are, the smoother the disparity is. P1 is the penalty on the disparity change by plus or minus 1 between neighbor pixels. P2 is the penalty on the disparity change by more than 1 between neighbor pixels. The algorithm requires P2 > P1 . See stereo_match.cpp sample where some reasonably good P1 and P2 values are shown (like 8*number_of_image_channels*blockSize*blockSize and 32*number_of_image_channels*blockSize*blockSize , respectively).
Definition at line 58 of file stereo.hpp.
Referenced by applyStereoMatching(), load(), main(), print(), and setDefaultValues().
int sl_oc::tools::StereoSgbmPar::preFilterCap |
[default: 63] Truncation value for the prefiltered image pixels. The algorithm first computes x-derivative at each pixel and clips its value by [-preFilterCap, preFilterCap] interval. The result values are passed to the Birchfield-Tomasi pixel cost function.
Definition at line 60 of file stereo.hpp.
Referenced by applyStereoMatching(), load(), main(), on_trackbar_preFilterCap(), print(), save(), and setDefaultValues().
int sl_oc::tools::StereoSgbmPar::speckleRange |
[default: 1] Maximum disparity variation within each connected component. If you do speckle filtering, set the parameter to a positive value, it will be implicitly multiplied by 16. Normally, 1 or 2 is good enough.
Definition at line 63 of file stereo.hpp.
Referenced by applyStereoMatching(), load(), main(), on_trackbar_speckleRange(), print(), save(), and setDefaultValues().
int sl_oc::tools::StereoSgbmPar::speckleWindowSize |
[default: 255] Maximum size of smooth disparity regions to consider their noise speckles and invalidate. Set it to 0 to disable speckle filtering. Otherwise, set it somewhere in the 50-200 range.
Definition at line 62 of file stereo.hpp.
Referenced by applyStereoMatching(), load(), main(), on_trackbar_speckleWindowSize(), print(), save(), and setDefaultValues().
int sl_oc::tools::StereoSgbmPar::uniquenessRatio |
[default: 5] Margin in percentage by which the best (minimum) computed cost function value should "win" the second best value to consider the found match correct. Normally, a value within the 5-15 range is good enough.
Definition at line 61 of file stereo.hpp.
Referenced by applyStereoMatching(), load(), main(), on_trackbar_uniquenessRatio(), print(), save(), and setDefaultValues().