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
FieldsModifier and TypeFieldDescriptionprotected intprotected intprotected ImageBorder<Input>protected intmaximum allowed image disparity (exclusive)protected intthe minimum disparity value (inclusive)protected intdifference between max and minInput image typeprotected Inputprotected intthe local disparity range at the current image coordinate in left to right directionprotected intthe local disparity range at the current image coordinate in right to left directionprotected final Inputprotected final Inputprotected intradius of the region along x and y axisprotected intradius of the region along x and y axisprotected Inputprotected intprotected intprotected intprotected int -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDisparitySparseRectifiedScoreBM(int radiusX, int radiusY, Class<Input> inputType) Configures disparity calculation.protectedDisparitySparseRectifiedScoreBM(Class<Input> inputType) Default constructor primarily for unit tests -
Method Summary
Modifier and TypeMethodDescriptionvoidconfigure(int disparityMin, int disparityRange) Configures the disparity searchprotected final voidCopies a local image patch so that the score function doesn't need to deal with image border issuesabstract ArrayDataArray containing disparity score computed by callingprocessLeftToRight(int, int).abstract ArrayDataArray containing disparity score computed by callingprocessRightToLeft(int, int).booleanprocessLeftToRight(int x, int y) Compute disparity scores for the specified pixel in left to right direction.booleanprocessRightToLeft(int x, int y) Compute disparity scores for the specified pixel in right to left direction.protected abstract voidscoreDisparity(int disparityRange, boolean leftToRight) Scores the disparity using image patches.voidsetBorder(ImageBorder<Input> border) Specifies how the image border is handledvoidSpecify inputs for left and right camera images.protected voidsetSampleRegion(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 todisparityMinand 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 todisparityMinand has a max value specified by#getLocalRangeRtoL()
-