http://www.emgu.com
Create a stereo disparity solver using StereoSGBM algorithm (combination of H. Hirschmuller + K. Konolige approaches)
Namespace: Emgu.CVAssembly: Emgu.CV.World (in Emgu.CV.World.dll) Version: 3.1.0.2282 (3.1.0.2282)
Syntaxpublic StereoSGBM(
int minDisparity,
int numDisparities,
int blockSize,
int p1 = 0,
int p2 = 0,
int disp12MaxDiff = 0,
int preFilterCap = 0,
int uniquenessRatio = 0,
int speckleWindowSize = 0,
int speckleRange = 0,
StereoSGBMMode mode = StereoSGBMMode.SGBM
)
Public Sub New (
minDisparity As Integer,
numDisparities As Integer,
blockSize As Integer,
Optional p1 As Integer = 0,
Optional p2 As Integer = 0,
Optional disp12MaxDiff As Integer = 0,
Optional preFilterCap As Integer = 0,
Optional uniquenessRatio As Integer = 0,
Optional speckleWindowSize As Integer = 0,
Optional speckleRange As Integer = 0,
Optional mode As StereoSGBMMode = StereoSGBMMode.SGBM
)
public:
StereoSGBM(
int minDisparity,
int numDisparities,
int blockSize,
int p1 = 0,
int p2 = 0,
int disp12MaxDiff = 0,
int preFilterCap = 0,
int uniquenessRatio = 0,
int speckleWindowSize = 0,
int speckleRange = 0,
StereoSGBMMode mode = StereoSGBMMode::SGBM
)
new :
minDisparity : int *
numDisparities : int *
blockSize : int *
?p1 : int *
?p2 : int *
?disp12MaxDiff : int *
?preFilterCap : int *
?uniquenessRatio : int *
?speckleWindowSize : int *
?speckleRange : int *
?mode : StereoSGBMMode
(* Defaults:
let _p1 = defaultArg p1 0
let _p2 = defaultArg p2 0
let _disp12MaxDiff = defaultArg disp12MaxDiff 0
let _preFilterCap = defaultArg preFilterCap 0
let _uniquenessRatio = defaultArg uniquenessRatio 0
let _speckleWindowSize = defaultArg speckleWindowSize 0
let _speckleRange = defaultArg speckleRange 0
let _mode = defaultArg mode StereoSGBMMode.SGBM
*)
-> StereoSGBM
Parameters
- minDisparity
- Type: SystemInt32
Minimum possible disparity value. Normally, it is zero but sometimes rectification algorithms can shift images, so this parameter needs to be adjusted accordingly. - numDisparities
- Type: SystemInt32
Maximum disparity minus minimum disparity. The value is always greater than zero. In the current implementation, this parameter must be divisible by 16. - blockSize
- Type: SystemInt32
Matched block size. It must be an odd number >=1 . Normally, it should be somewhere in the 3..11 range. Use 0 for default. - p1 (Optional)
- Type: SystemInt32
The first parameter controlling the disparity smoothness. It is the penalty on the disparity change by plus or minus 1 between neighbor pixels. Reasonably good value is 8*number_of_image_channels*SADWindowSize*SADWindowSize. Use 0 for default - p2 (Optional)
- Type: SystemInt32
The second parameter controlling the disparity smoothness. It is the penalty on the disparity change by more than 1 between neighbor pixels. The algorithm requires p2 > p1. Reasonably good value is 32*number_of_image_channels*SADWindowSize*SADWindowSize. Use 0 for default - disp12MaxDiff (Optional)
- Type: SystemInt32
Maximum allowed difference (in integer pixel units) in the left-right disparity check. Set it to a non-positive value to disable the check. - preFilterCap (Optional)
- Type: SystemInt32
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. - uniquenessRatio (Optional)
- Type: SystemInt32
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. - speckleWindowSize (Optional)
- Type: SystemInt32
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 - speckleRange (Optional)
- Type: SystemInt32
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. - mode (Optional)
- Type: Emgu.CVStereoSGBMMode
Set it to 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 false.
See Also