Table of Contents

Class StereoBM

Namespace
OpenCvSharp
Assembly
OpenCvSharp.dll

Semi-Global Stereo Matching

public class StereoBM : StereoMatcher, IDisposable
Inheritance
StereoBM
Implements
Inherited Members

Properties

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.

public int PreFilterCap { get; set; }

Property Value

int

PreFilterSize

public int PreFilterSize { get; set; }

Property Value

int

PreFilterType

public int PreFilterType { get; set; }

Property Value

int

ROI1

public Rect ROI1 { get; set; }

Property Value

Rect

ROI2

public Rect ROI2 { get; set; }

Property Value

Rect

SmallerBlockSize

public int SmallerBlockSize { get; set; }

Property Value

int

TextureThreshold

public int TextureThreshold { get; set; }

Property Value

int

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.

public int UniquenessRatio { get; set; }

Property Value

int

Methods

Create(int, int)

Creates StereoBM object. You can then call Compute() to compute disparity for a specific stereo pair.

public static StereoBM Create(int numDisparities = 0, int blockSize = 21)

Parameters

numDisparities int

the disparity search range. For each pixel algorithm will find the best disparity from 0 (default minimum disparity) to numDisparities. The search range can then be shifted by changing the minimum disparity.

blockSize int

the linear size of the blocks compared by the algorithm. The size should be odd (as the block is centered at the current pixel). Larger block size implies smoother, though less accurate disparity map. Smaller block size gives more detailed disparity map, but there is higher chance for algorithm to find a wrong correspondence.

Returns

StereoBM

A new StereoBM instance.