Class DisparitySparseRectifiedScoreBM<ArrayData,​Input extends ImageGray<Input>>

java.lang.Object
boofcv.alg.disparity.block.score.DisparitySparseRectifiedScoreBM<ArrayData,​Input>
Direct Known Subclasses:
DisparitySparseRectifiedScoreBM_F32, DisparitySparseRectifiedScoreBM_S32, SparseScoreRectifiedNcc

public abstract class DisparitySparseRectifiedScoreBM<ArrayData,​Input extends ImageGray<Input>>
extends Object
Base class for computing sparse stereo disparity scores using a block matching approach given a rectified stereo pair.
  • Field Details

    • disparityMin

      protected int disparityMin
      the minimum disparity value (inclusive)
    • disparityMax

      protected int disparityMax
      maximum allowed image disparity (exclusive)
    • disparityRange

      protected int disparityRange
      difference between max and min
    • localRangeLtoR

      protected int localRangeLtoR
      the local disparity range at the current image coordinate in left to right direction
    • localRangeRtoL

      protected int localRangeRtoL
      the local disparity range at the current image coordinate in right to left direction
    • radiusX

      protected int radiusX
      radius of the region along x and y axis
    • radiusY

      protected int radiusY
      radius of the region along x and y axis
    • blockWidth

      protected int blockWidth
    • blockHeight

      protected int blockHeight
    • sampledWidth

      protected int sampledWidth
    • sampledHeight

      protected int sampledHeight
    • left

      protected Input extends ImageGray<Input> left
    • border

      protected ImageBorder<Input extends ImageGray<Input>> border
    • inputType

      protected Class<Input extends ImageGray<Input>> inputType
      Input image type
    • patchTemplate

      protected final Input extends ImageGray<Input> patchTemplate
    • patchCompare

      protected final Input extends ImageGray<Input> patchCompare
    • sampleRadiusX

      protected int sampleRadiusX
    • sampleRadiusY

      protected int sampleRadiusY
  • Constructor Details

    • DisparitySparseRectifiedScoreBM

      protected DisparitySparseRectifiedScoreBM​(int radiusX, int radiusY, Class<Input> inputType)
      Configures disparity calculation.
      Parameters:
      radiusX - Radius of the rectangular region along x-axis.
      radiusY - Radius of the rectangular region along y-axis.
    • DisparitySparseRectifiedScoreBM

      protected DisparitySparseRectifiedScoreBM​(Class<Input> inputType)
      Default constructor primarily for unit tests
  • Method Details

    • setSampleRegion

      protected void setSampleRegion​(int radiusX, int radiusY)
    • setBorder

      public void setBorder​(ImageBorder<Input> border)
      Specifies how the image border is handled
    • configure

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

      public void setImages​(Input left, Input right)
      Specify inputs for left and right camera images.
      Parameters:
      left - Rectified left camera image.
      right - Rectified right camera image.
    • processLeftToRight

      public boolean processLeftToRight​(int x, int y)
      Compute disparity scores for the specified pixel in left to right direction. Be sure that its not too close to the image border.
      Parameters:
      x - x-coordinate of point
      y - y-coordinate of point.
    • processRightToLeft

      public boolean processRightToLeft​(int x, int y)
      Compute disparity scores for the specified pixel in right to left direction. Be sure that its not too close to the image border.
      Parameters:
      x - x-coordinate of point
      y - y-coordinate of point.
    • copy

      protected final void copy​(int startX, int startY, int length, Input src, Input dst)
      Copies a local image patch so that the score function doesn't need to deal with image border issues
    • scoreDisparity

      protected abstract void scoreDisparity​(int disparityRange, boolean leftToRight)
      Scores the disparity using image patches.
      Parameters:
      disparityRange - The local range for disparity
      leftToRight - If true then the disparity is being from in left to right direction (the typical)
    • getScoreLtoR

      public abstract ArrayData getScoreLtoR()
      Array containing disparity score computed by calling processLeftToRight(int, int). Each element corresponds to the disparity score relative to disparityMin and has a max value specified by #getLocalRangeLtoR()
    • getScoreRtoL

      public abstract ArrayData getScoreRtoL()
      Array containing disparity score computed by calling processRightToLeft(int, int). Each element corresponds to the disparity score relative to disparityMin and has a max value specified by #getLocalRangeRtoL()