OpenCV for Unity  2.6.0
Enox Software / Please refer to OpenCV official document ( http://docs.opencv.org/4.9.0/index.html ) for the details of the argument of the method.
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | List of all members
OpenCVForUnity.Calib3dModule.StereoSGBM Class Reference

The class implements the modified H. Hirschmuller algorithm [HH08] that differs from the original one as follows: More...

Inheritance diagram for OpenCVForUnity.Calib3dModule.StereoSGBM:
OpenCVForUnity.Calib3dModule.StereoMatcher OpenCVForUnity.CoreModule.Algorithm OpenCVForUnity.DisposableOpenCVObject OpenCVForUnity.DisposableObject

Public Member Functions

int getPreFilterCap ()
 
void setPreFilterCap (int preFilterCap)
 
int getUniquenessRatio ()
 
void setUniquenessRatio (int uniquenessRatio)
 
int getP1 ()
 
void setP1 (int P1)
 
int getP2 ()
 
void setP2 (int P2)
 
int getMode ()
 
void setMode (int mode)
 
- Public Member Functions inherited from OpenCVForUnity.Calib3dModule.StereoMatcher
void compute (Mat left, Mat right, Mat disparity)
 Computes disparity map for the specified stereo pair. More...
 
int getMinDisparity ()
 
void setMinDisparity (int minDisparity)
 
int getNumDisparities ()
 
void setNumDisparities (int numDisparities)
 
int getBlockSize ()
 
void setBlockSize (int blockSize)
 
int getSpeckleWindowSize ()
 
void setSpeckleWindowSize (int speckleWindowSize)
 
int getSpeckleRange ()
 
void setSpeckleRange (int speckleRange)
 
int getDisp12MaxDiff ()
 
void setDisp12MaxDiff (int disp12MaxDiff)
 
- Public Member Functions inherited from OpenCVForUnity.CoreModule.Algorithm
IntPtr getNativeObjAddr ()
 
virtual void clear ()
 Clears the algorithm state. More...
 
virtual bool empty ()
 Returns true if the Algorithm is empty (e.g. in the very beginning or after unsuccessful read. More...
 
void save (string filename)
 
virtual string getDefaultName ()
 
- Public Member Functions inherited from OpenCVForUnity.DisposableObject
void Dispose ()
 
void ThrowIfDisposed ()
 

Static Public Member Functions

static new StereoSGBM __fromPtr__ (IntPtr addr)
 
static StereoSGBM create (int minDisparity, int numDisparities, int blockSize, int P1, int P2, int disp12MaxDiff, int preFilterCap, int uniquenessRatio, int speckleWindowSize, int speckleRange, int mode)
 Creates StereoSGBM object. More...
 
static StereoSGBM create (int minDisparity, int numDisparities, int blockSize, int P1, int P2, int disp12MaxDiff, int preFilterCap, int uniquenessRatio, int speckleWindowSize, int speckleRange)
 Creates StereoSGBM object. More...
 
static StereoSGBM create (int minDisparity, int numDisparities, int blockSize, int P1, int P2, int disp12MaxDiff, int preFilterCap, int uniquenessRatio, int speckleWindowSize)
 Creates StereoSGBM object. More...
 
static StereoSGBM create (int minDisparity, int numDisparities, int blockSize, int P1, int P2, int disp12MaxDiff, int preFilterCap, int uniquenessRatio)
 Creates StereoSGBM object. More...
 
static StereoSGBM create (int minDisparity, int numDisparities, int blockSize, int P1, int P2, int disp12MaxDiff, int preFilterCap)
 Creates StereoSGBM object. More...
 
static StereoSGBM create (int minDisparity, int numDisparities, int blockSize, int P1, int P2, int disp12MaxDiff)
 Creates StereoSGBM object. More...
 
static StereoSGBM create (int minDisparity, int numDisparities, int blockSize, int P1, int P2)
 Creates StereoSGBM object. More...
 
static StereoSGBM create (int minDisparity, int numDisparities, int blockSize, int P1)
 Creates StereoSGBM object. More...
 
static StereoSGBM create (int minDisparity, int numDisparities, int blockSize)
 Creates StereoSGBM object. More...
 
static StereoSGBM create (int minDisparity, int numDisparities)
 Creates StereoSGBM object. More...
 
static StereoSGBM create (int minDisparity)
 Creates StereoSGBM object. More...
 
static StereoSGBM create ()
 Creates StereoSGBM object. More...
 
- Static Public Member Functions inherited from OpenCVForUnity.Calib3dModule.StereoMatcher
static new StereoMatcher __fromPtr__ (IntPtr addr)
 
- Static Public Member Functions inherited from OpenCVForUnity.CoreModule.Algorithm
static Algorithm __fromPtr__ (IntPtr addr)
 
- Static Public Member Functions inherited from OpenCVForUnity.DisposableObject
static IntPtr ThrowIfNullIntPtr (IntPtr ptr)
 

Public Attributes

const int MODE_SGBM = 0
 
const int MODE_HH = 1
 
const int MODE_SGBM_3WAY = 2
 
const int MODE_HH4 = 3
 
- Public Attributes inherited from OpenCVForUnity.Calib3dModule.StereoMatcher
const int DISP_SHIFT = 4
 
const int DISP_SCALE = (1 << DISP_SHIFT)
 

Protected Member Functions

override void Dispose (bool disposing)
 
- Protected Member Functions inherited from OpenCVForUnity.CoreModule.Algorithm
override void Dispose (bool disposing)
 
- Protected Member Functions inherited from OpenCVForUnity.DisposableOpenCVObject
 DisposableOpenCVObject ()
 
 DisposableOpenCVObject (IntPtr ptr)
 
 DisposableOpenCVObject (bool isEnabledDispose)
 
 DisposableOpenCVObject (IntPtr ptr, bool isEnabledDispose)
 
override void Dispose (bool disposing)
 
- Protected Member Functions inherited from OpenCVForUnity.DisposableObject
 DisposableObject ()
 
 DisposableObject (bool isEnabledDispose)
 

Additional Inherited Members

- Properties inherited from OpenCVForUnity.DisposableObject
bool IsDisposed [get, protected set]
 
bool IsEnabledDispose [get, set]
 

Detailed Description

The class implements the modified H. Hirschmuller algorithm [HH08] that differs from the original one as follows:

Note
  • (Python) An example illustrating the use of the StereoSGBM matching algorithm can be found at opencv_source_code/samples/python/stereo_match.py

Member Function Documentation

◆ __fromPtr__()

static new StereoSGBM OpenCVForUnity.Calib3dModule.StereoSGBM.__fromPtr__ ( IntPtr  addr)
static

◆ create() [1/12]

static StereoSGBM OpenCVForUnity.Calib3dModule.StereoSGBM.create ( int  minDisparity,
int  numDisparities,
int  blockSize,
int  P1,
int  P2,
int  disp12MaxDiff,
int  preFilterCap,
int  uniquenessRatio,
int  speckleWindowSize,
int  speckleRange,
int  mode 
)
static

Creates StereoSGBM object.

Parameters
minDisparityMinimum possible disparity value. Normally, it is zero but sometimes rectification algorithms can shift images, so this parameter needs to be adjusted accordingly.
numDisparitiesMaximum disparity minus minimum disparity. The value is always greater than zero. In the current implementation, this parameter must be divisible by 16.
blockSizeMatched block size. It must be an odd number >=1 . Normally, it should be somewhere in the 3..11 range.
P1The first parameter controlling the disparity smoothness. See below.
P2The 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).
disp12MaxDiffMaximum allowed difference (in integer pixel units) in the left-right disparity check. Set it to a non-positive value to disable the check.
preFilterCapTruncation 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.
uniquenessRatioMargin 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.
speckleWindowSizeMaximum 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.
speckleRangeMaximum 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.
modeSet 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 .

The first constructor initializes StereoSGBM with all the default parameters. So, you only have to set StereoSGBM::numDisparities at minimum. The second constructor enables you to set each parameter to a custom value.

◆ create() [2/12]

static StereoSGBM OpenCVForUnity.Calib3dModule.StereoSGBM.create ( int  minDisparity,
int  numDisparities,
int  blockSize,
int  P1,
int  P2,
int  disp12MaxDiff,
int  preFilterCap,
int  uniquenessRatio,
int  speckleWindowSize,
int  speckleRange 
)
static

Creates StereoSGBM object.

Parameters
minDisparityMinimum possible disparity value. Normally, it is zero but sometimes rectification algorithms can shift images, so this parameter needs to be adjusted accordingly.
numDisparitiesMaximum disparity minus minimum disparity. The value is always greater than zero. In the current implementation, this parameter must be divisible by 16.
blockSizeMatched block size. It must be an odd number >=1 . Normally, it should be somewhere in the 3..11 range.
P1The first parameter controlling the disparity smoothness. See below.
P2The 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).
disp12MaxDiffMaximum allowed difference (in integer pixel units) in the left-right disparity check. Set it to a non-positive value to disable the check.
preFilterCapTruncation 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.
uniquenessRatioMargin 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.
speckleWindowSizeMaximum 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.
speckleRangeMaximum 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.
modeSet 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 .

The first constructor initializes StereoSGBM with all the default parameters. So, you only have to set StereoSGBM::numDisparities at minimum. The second constructor enables you to set each parameter to a custom value.

◆ create() [3/12]

static StereoSGBM OpenCVForUnity.Calib3dModule.StereoSGBM.create ( int  minDisparity,
int  numDisparities,
int  blockSize,
int  P1,
int  P2,
int  disp12MaxDiff,
int  preFilterCap,
int  uniquenessRatio,
int  speckleWindowSize 
)
static

Creates StereoSGBM object.

Parameters
minDisparityMinimum possible disparity value. Normally, it is zero but sometimes rectification algorithms can shift images, so this parameter needs to be adjusted accordingly.
numDisparitiesMaximum disparity minus minimum disparity. The value is always greater than zero. In the current implementation, this parameter must be divisible by 16.
blockSizeMatched block size. It must be an odd number >=1 . Normally, it should be somewhere in the 3..11 range.
P1The first parameter controlling the disparity smoothness. See below.
P2The 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).
disp12MaxDiffMaximum allowed difference (in integer pixel units) in the left-right disparity check. Set it to a non-positive value to disable the check.
preFilterCapTruncation 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.
uniquenessRatioMargin 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.
speckleWindowSizeMaximum 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.
speckleRangeMaximum 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.
modeSet 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 .

The first constructor initializes StereoSGBM with all the default parameters. So, you only have to set StereoSGBM::numDisparities at minimum. The second constructor enables you to set each parameter to a custom value.

◆ create() [4/12]

static StereoSGBM OpenCVForUnity.Calib3dModule.StereoSGBM.create ( int  minDisparity,
int  numDisparities,
int  blockSize,
int  P1,
int  P2,
int  disp12MaxDiff,
int  preFilterCap,
int  uniquenessRatio 
)
static

Creates StereoSGBM object.

Parameters
minDisparityMinimum possible disparity value. Normally, it is zero but sometimes rectification algorithms can shift images, so this parameter needs to be adjusted accordingly.
numDisparitiesMaximum disparity minus minimum disparity. The value is always greater than zero. In the current implementation, this parameter must be divisible by 16.
blockSizeMatched block size. It must be an odd number >=1 . Normally, it should be somewhere in the 3..11 range.
P1The first parameter controlling the disparity smoothness. See below.
P2The 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).
disp12MaxDiffMaximum allowed difference (in integer pixel units) in the left-right disparity check. Set it to a non-positive value to disable the check.
preFilterCapTruncation 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.
uniquenessRatioMargin 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.
speckleWindowSizeMaximum 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.
speckleRangeMaximum 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.
modeSet 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 .

The first constructor initializes StereoSGBM with all the default parameters. So, you only have to set StereoSGBM::numDisparities at minimum. The second constructor enables you to set each parameter to a custom value.

◆ create() [5/12]

static StereoSGBM OpenCVForUnity.Calib3dModule.StereoSGBM.create ( int  minDisparity,
int  numDisparities,
int  blockSize,
int  P1,
int  P2,
int  disp12MaxDiff,
int  preFilterCap 
)
static

Creates StereoSGBM object.

Parameters
minDisparityMinimum possible disparity value. Normally, it is zero but sometimes rectification algorithms can shift images, so this parameter needs to be adjusted accordingly.
numDisparitiesMaximum disparity minus minimum disparity. The value is always greater than zero. In the current implementation, this parameter must be divisible by 16.
blockSizeMatched block size. It must be an odd number >=1 . Normally, it should be somewhere in the 3..11 range.
P1The first parameter controlling the disparity smoothness. See below.
P2The 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).
disp12MaxDiffMaximum allowed difference (in integer pixel units) in the left-right disparity check. Set it to a non-positive value to disable the check.
preFilterCapTruncation 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.
uniquenessRatioMargin 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.
speckleWindowSizeMaximum 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.
speckleRangeMaximum 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.
modeSet 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 .

The first constructor initializes StereoSGBM with all the default parameters. So, you only have to set StereoSGBM::numDisparities at minimum. The second constructor enables you to set each parameter to a custom value.

◆ create() [6/12]

static StereoSGBM OpenCVForUnity.Calib3dModule.StereoSGBM.create ( int  minDisparity,
int  numDisparities,
int  blockSize,
int  P1,
int  P2,
int  disp12MaxDiff 
)
static

Creates StereoSGBM object.

Parameters
minDisparityMinimum possible disparity value. Normally, it is zero but sometimes rectification algorithms can shift images, so this parameter needs to be adjusted accordingly.
numDisparitiesMaximum disparity minus minimum disparity. The value is always greater than zero. In the current implementation, this parameter must be divisible by 16.
blockSizeMatched block size. It must be an odd number >=1 . Normally, it should be somewhere in the 3..11 range.
P1The first parameter controlling the disparity smoothness. See below.
P2The 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).
disp12MaxDiffMaximum allowed difference (in integer pixel units) in the left-right disparity check. Set it to a non-positive value to disable the check.
preFilterCapTruncation 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.
uniquenessRatioMargin 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.
speckleWindowSizeMaximum 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.
speckleRangeMaximum 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.
modeSet 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 .

The first constructor initializes StereoSGBM with all the default parameters. So, you only have to set StereoSGBM::numDisparities at minimum. The second constructor enables you to set each parameter to a custom value.

◆ create() [7/12]

static StereoSGBM OpenCVForUnity.Calib3dModule.StereoSGBM.create ( int  minDisparity,
int  numDisparities,
int  blockSize,
int  P1,
int  P2 
)
static

Creates StereoSGBM object.

Parameters
minDisparityMinimum possible disparity value. Normally, it is zero but sometimes rectification algorithms can shift images, so this parameter needs to be adjusted accordingly.
numDisparitiesMaximum disparity minus minimum disparity. The value is always greater than zero. In the current implementation, this parameter must be divisible by 16.
blockSizeMatched block size. It must be an odd number >=1 . Normally, it should be somewhere in the 3..11 range.
P1The first parameter controlling the disparity smoothness. See below.
P2The 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).
disp12MaxDiffMaximum allowed difference (in integer pixel units) in the left-right disparity check. Set it to a non-positive value to disable the check.
preFilterCapTruncation 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.
uniquenessRatioMargin 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.
speckleWindowSizeMaximum 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.
speckleRangeMaximum 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.
modeSet 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 .

The first constructor initializes StereoSGBM with all the default parameters. So, you only have to set StereoSGBM::numDisparities at minimum. The second constructor enables you to set each parameter to a custom value.

◆ create() [8/12]

static StereoSGBM OpenCVForUnity.Calib3dModule.StereoSGBM.create ( int  minDisparity,
int  numDisparities,
int  blockSize,
int  P1 
)
static

Creates StereoSGBM object.

Parameters
minDisparityMinimum possible disparity value. Normally, it is zero but sometimes rectification algorithms can shift images, so this parameter needs to be adjusted accordingly.
numDisparitiesMaximum disparity minus minimum disparity. The value is always greater than zero. In the current implementation, this parameter must be divisible by 16.
blockSizeMatched block size. It must be an odd number >=1 . Normally, it should be somewhere in the 3..11 range.
P1The first parameter controlling the disparity smoothness. See below.
P2The 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).
disp12MaxDiffMaximum allowed difference (in integer pixel units) in the left-right disparity check. Set it to a non-positive value to disable the check.
preFilterCapTruncation 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.
uniquenessRatioMargin 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.
speckleWindowSizeMaximum 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.
speckleRangeMaximum 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.
modeSet 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 .

The first constructor initializes StereoSGBM with all the default parameters. So, you only have to set StereoSGBM::numDisparities at minimum. The second constructor enables you to set each parameter to a custom value.

◆ create() [9/12]

static StereoSGBM OpenCVForUnity.Calib3dModule.StereoSGBM.create ( int  minDisparity,
int  numDisparities,
int  blockSize 
)
static

Creates StereoSGBM object.

Parameters
minDisparityMinimum possible disparity value. Normally, it is zero but sometimes rectification algorithms can shift images, so this parameter needs to be adjusted accordingly.
numDisparitiesMaximum disparity minus minimum disparity. The value is always greater than zero. In the current implementation, this parameter must be divisible by 16.
blockSizeMatched block size. It must be an odd number >=1 . Normally, it should be somewhere in the 3..11 range.
P1The first parameter controlling the disparity smoothness. See below.
P2The 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).
disp12MaxDiffMaximum allowed difference (in integer pixel units) in the left-right disparity check. Set it to a non-positive value to disable the check.
preFilterCapTruncation 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.
uniquenessRatioMargin 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.
speckleWindowSizeMaximum 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.
speckleRangeMaximum 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.
modeSet 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 .

The first constructor initializes StereoSGBM with all the default parameters. So, you only have to set StereoSGBM::numDisparities at minimum. The second constructor enables you to set each parameter to a custom value.

◆ create() [10/12]

static StereoSGBM OpenCVForUnity.Calib3dModule.StereoSGBM.create ( int  minDisparity,
int  numDisparities 
)
static

Creates StereoSGBM object.

Parameters
minDisparityMinimum possible disparity value. Normally, it is zero but sometimes rectification algorithms can shift images, so this parameter needs to be adjusted accordingly.
numDisparitiesMaximum disparity minus minimum disparity. The value is always greater than zero. In the current implementation, this parameter must be divisible by 16.
blockSizeMatched block size. It must be an odd number >=1 . Normally, it should be somewhere in the 3..11 range.
P1The first parameter controlling the disparity smoothness. See below.
P2The 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).
disp12MaxDiffMaximum allowed difference (in integer pixel units) in the left-right disparity check. Set it to a non-positive value to disable the check.
preFilterCapTruncation 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.
uniquenessRatioMargin 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.
speckleWindowSizeMaximum 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.
speckleRangeMaximum 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.
modeSet 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 .

The first constructor initializes StereoSGBM with all the default parameters. So, you only have to set StereoSGBM::numDisparities at minimum. The second constructor enables you to set each parameter to a custom value.

◆ create() [11/12]

static StereoSGBM OpenCVForUnity.Calib3dModule.StereoSGBM.create ( int  minDisparity)
static

Creates StereoSGBM object.

Parameters
minDisparityMinimum possible disparity value. Normally, it is zero but sometimes rectification algorithms can shift images, so this parameter needs to be adjusted accordingly.
numDisparitiesMaximum disparity minus minimum disparity. The value is always greater than zero. In the current implementation, this parameter must be divisible by 16.
blockSizeMatched block size. It must be an odd number >=1 . Normally, it should be somewhere in the 3..11 range.
P1The first parameter controlling the disparity smoothness. See below.
P2The 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).
disp12MaxDiffMaximum allowed difference (in integer pixel units) in the left-right disparity check. Set it to a non-positive value to disable the check.
preFilterCapTruncation 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.
uniquenessRatioMargin 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.
speckleWindowSizeMaximum 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.
speckleRangeMaximum 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.
modeSet 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 .

The first constructor initializes StereoSGBM with all the default parameters. So, you only have to set StereoSGBM::numDisparities at minimum. The second constructor enables you to set each parameter to a custom value.

◆ create() [12/12]

static StereoSGBM OpenCVForUnity.Calib3dModule.StereoSGBM.create ( )
static

Creates StereoSGBM object.

Parameters
minDisparityMinimum possible disparity value. Normally, it is zero but sometimes rectification algorithms can shift images, so this parameter needs to be adjusted accordingly.
numDisparitiesMaximum disparity minus minimum disparity. The value is always greater than zero. In the current implementation, this parameter must be divisible by 16.
blockSizeMatched block size. It must be an odd number >=1 . Normally, it should be somewhere in the 3..11 range.
P1The first parameter controlling the disparity smoothness. See below.
P2The 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).
disp12MaxDiffMaximum allowed difference (in integer pixel units) in the left-right disparity check. Set it to a non-positive value to disable the check.
preFilterCapTruncation 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.
uniquenessRatioMargin 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.
speckleWindowSizeMaximum 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.
speckleRangeMaximum 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.
modeSet 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 .

The first constructor initializes StereoSGBM with all the default parameters. So, you only have to set StereoSGBM::numDisparities at minimum. The second constructor enables you to set each parameter to a custom value.

◆ Dispose()

override void OpenCVForUnity.Calib3dModule.StereoSGBM.Dispose ( bool  disposing)
protectedvirtual

◆ getMode()

int OpenCVForUnity.Calib3dModule.StereoSGBM.getMode ( )

◆ getP1()

int OpenCVForUnity.Calib3dModule.StereoSGBM.getP1 ( )

◆ getP2()

int OpenCVForUnity.Calib3dModule.StereoSGBM.getP2 ( )

◆ getPreFilterCap()

int OpenCVForUnity.Calib3dModule.StereoSGBM.getPreFilterCap ( )

◆ getUniquenessRatio()

int OpenCVForUnity.Calib3dModule.StereoSGBM.getUniquenessRatio ( )

◆ setMode()

void OpenCVForUnity.Calib3dModule.StereoSGBM.setMode ( int  mode)

◆ setP1()

void OpenCVForUnity.Calib3dModule.StereoSGBM.setP1 ( int  P1)

◆ setP2()

void OpenCVForUnity.Calib3dModule.StereoSGBM.setP2 ( int  P2)

◆ setPreFilterCap()

void OpenCVForUnity.Calib3dModule.StereoSGBM.setPreFilterCap ( int  preFilterCap)

◆ setUniquenessRatio()

void OpenCVForUnity.Calib3dModule.StereoSGBM.setUniquenessRatio ( int  uniquenessRatio)

Member Data Documentation

◆ MODE_HH

const int OpenCVForUnity.Calib3dModule.StereoSGBM.MODE_HH = 1

◆ MODE_HH4

const int OpenCVForUnity.Calib3dModule.StereoSGBM.MODE_HH4 = 3

◆ MODE_SGBM

const int OpenCVForUnity.Calib3dModule.StereoSGBM.MODE_SGBM = 0

◆ MODE_SGBM_3WAY

const int OpenCVForUnity.Calib3dModule.StereoSGBM.MODE_SGBM_3WAY = 2

The documentation for this class was generated from the following file: