Class DisparityBlockMatchRowFormat<Input extends ImageBase<Input>,Disparity extends ImageGray<Disparity>>

java.lang.Object
boofcv.alg.disparity.DisparityBlockMatchRowFormat<Input,Disparity>
Direct Known Subclasses:
DisparityBlockMatch, DisparityBlockMatchBestFive

public abstract class DisparityBlockMatchRowFormat<Input extends ImageBase<Input>,Disparity extends ImageGray<Disparity>> extends Object

Base class for all dense stereo disparity score algorithms whose score's can be processed by DisparitySelect. The scores for all possible disparities at each pixel is computed for an entire row at once. Then DisparitySelect is called to process this score.

Score Format: The index of the score for column i ≥ radiusX + minDisparity at disparity d is:
index = imgWidth*(d-minDisparity-radiusX) + i - minDisparity-radiusX
Format Comment:
This ordering is a bit unnatural when searching for the best disparity, but reduces cache misses when writing. Performance boost is about 20%-30% depending on max disparity and image size.

  • Field Details

    • disparityMin

      protected int disparityMin
    • disparityMax

      protected int disparityMax
    • disparityRange

      protected int disparityRange
    • widthDisparityBlock

      protected int widthDisparityBlock
    • radiusX

      protected int radiusX
    • radiusY

      protected int radiusY
    • regionWidth

      protected int regionWidth
    • regionHeight

      protected int regionHeight
    • growBorderL

      protected GrowBorder<Input extends ImageBase<Input>,Object> growBorderL
    • growBorderR

      protected GrowBorder<Input extends ImageBase<Input>,Object> growBorderR
  • Constructor Details

    • DisparityBlockMatchRowFormat

      protected DisparityBlockMatchRowFormat(int regionRadiusX, int regionRadiusY, ImageType<Input> imageType)
      Configures disparity calculation.
      Parameters:
      regionRadiusX - Radius of the rectangular region along x-axis.
      regionRadiusY - Radius of the rectangular region along y-axis.
  • Method Details

    • setBorder

      public void setBorder(ImageBorder<Input> border)
    • configure

      public void configure(int disparityMin, int disparityRange)
      Configures the disparity search
      Parameters:
      disparityMin - Minimum disparity that it will check. Must be ≥ 0 and < maxDisparity
      disparityRange - Number of possible disparity values estimated. The max possible disparity is min+range-1.
    • process

      public void process(Input left, Input right, Disparity disparity, @Nullable @Nullable GrayF32 score)
      Computes disparity between two stereo images
      Parameters:
      left - Left rectified stereo image. Input
      right - Right rectified stereo image. Input
      disparity - Disparity between the two images. Output
      score - Optional storage for best fit score
    • _process

      public abstract void _process(Input left, Input right, Disparity disparity, @Nullable @Nullable GrayF32 score)
      Inner function that computes the disparity.
    • getInputType

      public abstract ImageType<Input> getInputType()
    • getDisparityType

      public abstract Class<Disparity> getDisparityType()
    • getBorderX

      public int getBorderX()
    • getBorderY

      public int getBorderY()
    • getMaxRegionError

      public int getMaxRegionError()
      The maximum possible error for the region
    • getMaxPerPixelError

      protected abstract int getMaxPerPixelError()