Class SelectDisparityWithChecksWta<Array,DI extends ImageGray<DI>>
- All Implemented Interfaces:
DisparitySelect<Array,
DI>
- Direct Known Subclasses:
SelectCorrelationWithChecks_F32
,SelectErrorWithChecks_F32
,SelectErrorWithChecks_S32
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
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
protected int
protected int
protected int
protected SelectDisparityWithChecksWta.SaveScore
protected DI
protected @Nullable GrayF32
protected int
protected int
protected int
protected int
protected int
protected int
-
Constructor Summary
ModifierConstructorDescriptionprotected
SelectDisparityWithChecksWta
(int maxError, int rightToLeftTolerance, double texture, Class<DI> disparityType) Configures tolerances -
Method Summary
Modifier and TypeMethodDescriptionvoid
configure
(DI imageDisparity, @Nullable GrayF32 imageScore, int disparityMin, int disparityMax, int radiusX) Specifies the output and algorithmic configuration.protected int
disparityMaxAtColumnL2R
(int col) Returns the maximum allowed disparity for a particular column in left to right direction, as limited by the image border.Type of image the disparity isprotected abstract void
setDisparity
(int index, int disparityValue, float bestScore) Sets the output to the specified disparity value.protected abstract void
setDisparityInvalid
(int index) void
setLocalDisparityMax
(int value) For debugging purposes onlyabstract void
setTexture
(double threshold) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface boofcv.alg.disparity.block.DisparitySelect
concurrentCopy, process
-
Field Details
-
DISCRETIZER
public static final int DISCRETIZER- See Also:
-
imageDisparity
-
imageScore
-
disparityMin
protected int disparityMin -
disparityMax
protected int disparityMax -
disparityRange
protected int disparityRange -
invalidDisparity
protected int invalidDisparity -
localRange
protected int localRange -
radiusX
protected int radiusX -
regionWidth
protected int regionWidth -
maxError
protected int maxError -
rightToLeftTolerance
protected int rightToLeftTolerance -
disparityType
-
funcSaveScore
-
-
Constructor Details
-
SelectDisparityWithChecksWta
protected SelectDisparityWithChecksWta(int maxError, int rightToLeftTolerance, double texture, Class<DI> disparityType) Configures tolerances- Parameters:
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.1
-
-
Method Details
-
setTexture
public abstract void setTexture(double threshold) -
configure
public void configure(DI imageDisparity, @Nullable @Nullable GrayF32 imageScore, int disparityMin, int disparityMax, int radiusX) Description copied from interface:DisparitySelect
Specifies the output and algorithmic configuration.- Specified by:
configure
in interfaceDisparitySelect<Array,
DI extends ImageGray<DI>> - Parameters:
imageDisparity
- Output disparity image.imageScore
- If not null, then the score for best fit disparity will be stored here.disparityMin
- Minimum disparity that can be computeddisparityMax
- Maximum disparity that is calculatedradiusX
- Radius of the rectangular region being matched along x-axis.
-
setDisparity
protected abstract void setDisparity(int index, int disparityValue, float bestScore) Sets the output to the specified disparity value.- Parameters:
index
- Image pixel that is being setdisparityValue
- disparity valuebestScore
- Score of the best disparity value
-
setDisparityInvalid
protected abstract void setDisparityInvalid(int index) -
disparityMaxAtColumnL2R
protected int disparityMaxAtColumnL2R(int col) Returns the maximum allowed disparity for a particular column in left to right direction, as limited by the image border. -
setLocalDisparityMax
public void setLocalDisparityMax(int value) For debugging purposes only -
getDisparityType
Description copied from interface:DisparitySelect
Type of image the disparity is- Specified by:
getDisparityType
in interfaceDisparitySelect<Array,
DI extends ImageGray<DI>> - Returns:
- Image type for disparity
-