Table of Contents

Class DisparityWLSFilter

Namespace
OpenCvSharp.XImgProc
Assembly
OpenCvSharp.dll

Disparity map filter based on Weighted Least Squares filter (in form of Fast Global Smoother that is a lot faster than traditional Weighted Least Squares filter implementations) and optional use of left-right-consistency-based confidence to refine the results in half-occlusions and uniform areas.

public class DisparityWLSFilter : DisparityFilter, IDisposable
Inheritance
DisparityWLSFilter
Implements
Inherited Members

Properties

DepthDiscontinuityRadius

DepthDiscontinuityRadius is a parameter used in confidence computation. It defines the size of low-confidence regions around depth discontinuities.

public int DepthDiscontinuityRadius { get; set; }

Property Value

int

LRCthresh

LRCthresh is a threshold of disparity difference used in left-right-consistency check during confidence map computation. The default value of 24 (1.5 pixels) is virtually always good enough.

public int LRCthresh { get; set; }

Property Value

int

Lambda

Lambda is a parameter defining the amount of regularization during filtering. Larger values force filtered disparity map edges to adhere more to source image edges. Typical value is 8000.

public double Lambda { get; set; }

Property Value

double

SigmaColor

SigmaColor is a parameter defining how sensitive the filtering process is to source image edges. Large values can lead to disparity leakage through low-contrast edges. Small values can make the filter too sensitive to noise and textures in the source image. Typical values range from 0.8 to 2.0.

public double SigmaColor { get; set; }

Property Value

double

Methods

Create(StereoMatcher)

Convenience factory method that creates an instance of DisparityWLSFilter and sets up all the relevant filter parameters automatically based on the matcher instance. Currently supports only StereoBM and StereoSGBM.

public static DisparityWLSFilter Create(StereoMatcher matcherLeft)

Parameters

matcherLeft StereoMatcher

stereo matcher instance that will be used with the filter.

Returns

DisparityWLSFilter

CreateGeneric(bool)

More generic factory method, creates an instance of DisparityWLSFilter and executes basic initialization routines. When using this method you will need to set up the ROI, matchers and other parameters by yourself.

public static DisparityWLSFilter CreateGeneric(bool useConfidence)

Parameters

useConfidence bool

filtering with confidence requires two disparity maps (for the left and right views) and is approximately two times slower. However, quality is typically significantly better.

Returns

DisparityWLSFilter

GetConfidenceMap()

Get the confidence map that was used in the last Filter call. It is a CV_32F one-channel image with values ranging from 0.0 (totally untrusted regions of the raw disparity map) to 255.0 (regions containing correct disparity values with a high degree of confidence).

public Mat GetConfidenceMap()

Returns

Mat

GetROI()

Get the ROI used in the last Filter call.

public Rect GetROI()

Returns

Rect