public abstract class SelectRectStandard<Array,T extends ImageSingleBand> extends java.lang.Object implements DisparitySelect<Array,T>
Selects the disparity with the smallest error, which is known as the winner takes all (WTA) strategy. Optionally several different techniques can be used to filter out bad disparity values. This is a base class for algorithms which implement this same "standard" algorithm on different data types.
Validation Filters:
MaxError is the largest error value the selected region can have.
right To Left validates the disparity by seeing if the matched region on the right has the same region on
the left as its optimal solution, within tolerance.
texture Tolerance for how similar the best region is to the second best. Lower values indicate greater
tolerance. Reject if textureTol <= (C2-C1)/C1, where C2 = second best region score and C1 = best region score
This implementation is not based off of any individual paper but ideas commonly expressed in several different
sources. A good study and summary of similar algorithms can be found in:
[1] Wannes van der Mark and Dariu M. Gavrila, "Real-Time Dense Stereo for Intelligent Vehicles"
IEEE TRANSACTIONS ON INTELLIGENT TRANSPORTATION SYSTEMS, VOL. 7, NO. 1, MARCH 2006
Modifier and Type | Field and Description |
---|---|
protected T |
imageDisparity |
protected int |
invalidDisparity |
protected int |
localMax |
protected int |
maxDisparity |
protected int |
maxError |
protected int |
minDisparity |
protected int |
radiusX |
protected int |
rangeDisparity |
protected int |
regionWidth |
protected int |
rightToLeftTolerance |
Constructor and Description |
---|
SelectRectStandard(int maxError,
int rightToLeftTolerance,
double texture)
Configures tolerances
|
Modifier and Type | Method and Description |
---|---|
void |
configure(T imageDisparity,
int minDisparity,
int maxDisparity,
int radiusX)
Specifies the output and algorithmic configuration.
|
protected int |
maxDisparityAtColumnL2R(int col)
Returns the maximum allowed disparity for a particular column in left to right direction,
as limited by the image border.
|
protected abstract void |
setDisparity(int index,
int disparityValue)
Sets the output to the specified disparity value.
|
void |
setLocalMax(int value)
For debugging purposes only
|
abstract void |
setTexture(double threshold) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getDisparityType, process
protected T extends ImageSingleBand imageDisparity
protected int minDisparity
protected int maxDisparity
protected int rangeDisparity
protected int invalidDisparity
protected int localMax
protected int radiusX
protected int regionWidth
protected int maxError
protected int rightToLeftTolerance
public SelectRectStandard(int maxError, int rightToLeftTolerance, double texture)
maxError
- The maximum allowed error. Note this is sum error and not per pixel error.
Try (region width*height)*30.rightToLeftTolerance
- Tolerance for how difference the left to right associated values can be. Try 6texture
- Tolerance for how similar optimal region is to other region. Disable with a value <= 0.
Closer to zero is more tolerant. Try 0.1public abstract void setTexture(double threshold)
public void configure(T imageDisparity, int minDisparity, int maxDisparity, int radiusX)
DisparitySelect
configure
in interface DisparitySelect<Array,T extends ImageSingleBand>
imageDisparity
- Output disparity image.minDisparity
- Minimum disparity that can be computedmaxDisparity
- Maximum disparity that is calculatedradiusX
- Radius of the rectangular region being matched along x-axis.protected abstract void setDisparity(int index, int disparityValue)
index
- Image pixel that is being setdisparityValue
- disparity valueprotected int maxDisparityAtColumnL2R(int col)
public void setLocalMax(int value)
Copyright © 2011-2012 Peter Abeles