Package boofcv.alg.disparity.block.score
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 Summary
Modifier and TypeFieldDescriptionprotected int
protected int
protected ImageBorder<Input>
protected int
maximum allowed image disparity (exclusive)protected int
the minimum disparity value (inclusive)protected int
difference between max and minInput image typeprotected Input
protected int
the local disparity range at the current image coordinate in left to right directionprotected int
the local disparity range at the current image coordinate in right to left directionprotected final Input
protected final Input
protected int
radius of the region along x and y axisprotected int
radius of the region along x and y axisprotected Input
protected int
protected int
protected int
protected int
-
Constructor Summary
ModifierConstructorDescriptionprotected
DisparitySparseRectifiedScoreBM
(int radiusX, int radiusY, Class<Input> inputType) Configures disparity calculation.protected
DisparitySparseRectifiedScoreBM
(Class<Input> inputType) Default constructor primarily for unit tests -
Method Summary
Modifier and TypeMethodDescriptionvoid
configure
(int disparityMin, int disparityRange) Configures the disparity searchprotected final void
Copies a local image patch so that the score function doesn't need to deal with image border issuesabstract ArrayData
Array containing disparity score computed by callingprocessLeftToRight(int, int)
.abstract ArrayData
Array containing disparity score computed by callingprocessRightToLeft(int, int)
.boolean
processLeftToRight
(int x, int y) Compute disparity scores for the specified pixel in left to right direction.boolean
processRightToLeft
(int x, int y) Compute disparity scores for the specified pixel in right to left direction.protected abstract void
scoreDisparity
(int disparityRange, boolean leftToRight) Scores the disparity using image patches.void
setBorder
(ImageBorder<Input> border) Specifies how the image border is handledvoid
Specify inputs for left and right camera images.protected void
setSampleRegion
(int radiusX, int radiusY)
-
Field Details
-
disparityMin
protected int disparityMinthe minimum disparity value (inclusive) -
disparityMax
protected int disparityMaxmaximum allowed image disparity (exclusive) -
disparityRange
protected int disparityRangedifference between max and min -
localRangeLtoR
protected int localRangeLtoRthe local disparity range at the current image coordinate in left to right direction -
localRangeRtoL
protected int localRangeRtoLthe local disparity range at the current image coordinate in right to left direction -
radiusX
protected int radiusXradius of the region along x and y axis -
radiusY
protected int radiusYradius 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
-
right
-
border
-
inputType
Input image type -
patchTemplate
-
patchCompare
-
sampleRadiusX
protected int sampleRadiusX -
sampleRadiusY
protected int sampleRadiusY
-
-
Constructor Details
-
DisparitySparseRectifiedScoreBM
Configures disparity calculation.- Parameters:
radiusX
- Radius of the rectangular region along x-axis.radiusY
- Radius of the rectangular region along y-axis.
-
DisparitySparseRectifiedScoreBM
Default constructor primarily for unit tests
-
-
Method Details
-
setSampleRegion
protected void setSampleRegion(int radiusX, int radiusY) -
setBorder
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 < disparityMaxdisparityRange
- Number of possible disparity values estimated. The max possible disparity is min+range-1.
-
setImages
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 pointy
- 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 pointy
- y-coordinate of point.
-
copy
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 disparityleftToRight
- If true then the disparity is being from in left to right direction (the typical)
-
getScoreLtoR
Array containing disparity score computed by callingprocessLeftToRight(int, int)
. Each element corresponds to the disparity score relative todisparityMin
and has a max value specified by#getLocalRangeLtoR()
-
getScoreRtoL
Array containing disparity score computed by callingprocessRightToLeft(int, int)
. Each element corresponds to the disparity score relative todisparityMin
and has a max value specified by#getLocalRangeRtoL()
-