Class StereoBM
Represents the block matching algorithm for computing stereo correspondence.
Namespace: OpenCV.Net
Assembly: OpenCV.Net.dll
Syntax
public class StereoBM : SafeHandleZeroOrMinusOneIsInvalid
Constructors
| Improve this Doc View SourceStereoBM(StereoBMPreset, Int32)
Initializes a new instance of the StereoBM class with the specified
parameter preset
and numberOfDisparities
.
Declaration
public StereoBM(StereoBMPreset preset = default(StereoBMPreset), int numberOfDisparities = 0)
Parameters
Type | Name | Description |
---|---|---|
StereoBMPreset | preset | Specifies the whole set of algorithm parameters. |
Int32 | numberOfDisparities | The disparity search range. For each pixel algorithm will find the best disparity from 0
(default minimum disparity) to |
Properties
| Improve this Doc View SourceDisparity12MaxDiff
Gets or sets the maximum allowed difference between the explicitly computed left-to-right disparity map and the implicitly computed right-to-left disparity. If for some pixel the difference is larger than the specified threshold, the disparity at the pixel is invalidated. By default this parameter is set to (-1), which means that the left-right check is not performed.
Declaration
public int Disparity12MaxDiff { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
MinDisparity
Gets or sets the minimum disparity (can be negative).
Declaration
public int MinDisparity { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
NumberOfDisparities
Gets or sets the difference between the maximum disparity and minimum disparity.
Declaration
public int NumberOfDisparities { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
PreFilterCap
Gets or sets the cap for pre-filtering. The output is clipped to be within [-PreFilterCap,PreFilterCap].
Declaration
public int PreFilterCap { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
PreFilterSize
Gets or sets the pre-filter averaging window size. Must be odd.
Declaration
public int PreFilterSize { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
PreFilterType
Gets or sets the block matching pre-filter type.
Declaration
public StereoBMPreFilterType PreFilterType { get; set; }
Property Value
Type | Description |
---|---|
StereoBMPreFilterType |
Roi1
Gets or sets the clipping ROI for the left image.
Declaration
public Rect Roi1 { get; set; }
Property Value
Type | Description |
---|---|
Rect |
Roi2
Gets or sets the clipping ROI for the right image.
Declaration
public Rect Roi2 { get; set; }
Property Value
Type | Description |
---|---|
Rect |
SadWindowSize
Gets or sets the Sum of Absolute Differences window size. Must be odd.
Declaration
public int SadWindowSize { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
SpeckleRange
Gets or sets the acceptable range of variation in window.
Declaration
public int SpeckleRange { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
SpeckleWindowSize
Gets or sets the size of the disparity variation window.
Declaration
public int SpeckleWindowSize { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
TextureThreshold
Gets or sets the texture threshold. The disparity is only computed for pixels with textured enough neighborhood.
Declaration
public int TextureThreshold { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
TrySmallerWindows
Gets or sets a value indicating whether to use smaller windows. The results may be more accurate, at the expense of slower processing.
Declaration
public bool TrySmallerWindows { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
UniquenessRatio
Gets or sets the uniqueness ratio. The computed computed disparity d* should only be accepted if SAD(d) >= SAD(d*)(1 + uniquenessRatio/100) for any d != d+/-1 within the search range.
Declaration
public int UniquenessRatio { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
Methods
| Improve this Doc View SourceFindStereoCorrespondence(Arr, Arr, Arr)
Computes the disparity map using block matching algorithm.
Declaration
public void FindStereoCorrespondence(Arr left, Arr right, Arr disparity)
Parameters
Type | Name | Description |
---|---|---|
Arr | left | The left single-channel, 8-bit image. |
Arr | right | The right image of the same size and the same type. |
Arr | disparity | The output single-channel 16-bit signed, or 32-bit floating-point disparity map of the same size as input images. In the first case the computed disparities are represented as fixed-point numbers with 4 fractional bits (i.e. the computed disparity values are multiplied by 16 and rounded to integers). |
ReleaseHandle()
Executes the code required to free the native StereoBM handle.
Declaration
protected override bool ReleaseHandle()
Returns
Type | Description |
---|---|
Boolean | true if the handle is released successfully; otherwise, in the event of a catastrophic failure, false. |