Class SelectDisparityWithChecksWta<Array,DI extends ImageGray<DI>>

java.lang.Object
boofcv.alg.disparity.block.SelectDisparityWithChecksWta<Array,DI>
All Implemented Interfaces:
DisparitySelect<Array,DI>
Direct Known Subclasses:
SelectCorrelationWithChecks_F32, SelectErrorWithChecks_F32, SelectErrorWithChecks_S32

public abstract class SelectDisparityWithChecksWta<Array,DI extends ImageGray<DI>> extends Object implements DisparitySelect<Array,DI>

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

  • Field Details

    • DISCRETIZER

      public static final int DISCRETIZER
      See Also:
    • imageDisparity

      protected DI extends ImageGray<DI> imageDisparity
    • imageScore

      @Nullable protected @Nullable GrayF32 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

      protected Class<DI extends ImageGray<DI>> disparityType
    • funcSaveScore

      protected SelectDisparityWithChecksWta.SaveScore 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 6
      texture - 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 interface DisparitySelect<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 computed
      disparityMax - Maximum disparity that is calculated
      radiusX - 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 set
      disparityValue - disparity value
      bestScore - 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

      public Class<DI> getDisparityType()
      Description copied from interface: DisparitySelect
      Type of image the disparity is
      Specified by:
      getDisparityType in interface DisparitySelect<Array,DI extends ImageGray<DI>>
      Returns:
      Image type for disparity