Class StereoSGBM
Semi-Global Stereo Matching
Implements
Inherited Members
Namespace: OpenCvSharp
Assembly: OpenCvSharp.dll
Syntax
public class StereoSGBM : StereoMatcher, ICvPtrHolder
Constructors
| Improve this Doc View SourceStereoSGBM(IntPtr)
constructor
Declaration
protected StereoSGBM(IntPtr ptr)
Parameters
Type | Name | Description |
---|---|---|
IntPtr | ptr |
Properties
| Improve this Doc View SourceMode
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 false .
Declaration
public StereoSGBMMode Mode { get; set; }
Property Value
Type | Description |
---|---|
StereoSGBMMode |
P1
The first parameter controlling the disparity smoothness. See P2 description.
Declaration
public int P1 { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
P2
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*SADWindowSize*SADWindowSize and 32*number_of_image_channels*SADWindowSize*SADWindowSize , respectively).
Declaration
public int P2 { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
PreFilterCap
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.
Declaration
public int PreFilterCap { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
UniquenessRatio
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.
Declaration
public int UniquenessRatio { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Methods
| Improve this Doc View SourceCreate(Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32, StereoSGBMMode)
Declaration
public static StereoSGBM Create(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)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | minDisparity | |
System.Int32 | numDisparities | |
System.Int32 | blockSize | |
System.Int32 | p1 | |
System.Int32 | p2 | |
System.Int32 | disp12MaxDiff | |
System.Int32 | preFilterCap | |
System.Int32 | uniquenessRatio | |
System.Int32 | speckleWindowSize | |
System.Int32 | speckleRange | |
StereoSGBMMode | mode |
Returns
Type | Description |
---|---|
StereoSGBM |
DisposeManaged()
Releases managed resources
Declaration
protected override void DisposeManaged()